CombinedText stringlengths 4 3.42M |
|---|
--
-- The demo of type hierarchy use: declarations, loops, dereferencing..
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
with Ada.Command_Line, GNAT.Command_Line;
with Ada.Text_IO, Ada.Integer_Text_IO;
use Ada.Text_IO;
with Ada.Containers.Vectors;
with lists.Fixed;
with lists.Dynamic;
with lists.Vectors;
with Base; use Base;
procedure Test_list_combo is
package ACV is new Ada.Containers.Vectors(Base.Index, Base_Fixed5);
package PL is new Lists(Base.Index_Base, Base_Interface);
package PLF is new PL.Fixed(Base_Fixed5);
package PLDD is new PL.Dynamic(Base_Dynamic);
package PLDV is new PL.Dynamic(Base_Vector);
package PLVV is new PL.Vectors(Base_Vector);
-- lc : PL.List_Interface'Class := PLD.To_Vector(5);
begin -- main
Put_Line("testing Ada.Containers.Vectors..");
declare
v : ACV.Vector := ACV.To_Vector(5);
begin
Put("assigning values .. ");
for i in Base.Index range 1 .. 5 loop
v(i) := set_idx_fixed(i);
end loop;
Put_Line("done; values (of-loop): ");
for item of v loop
item.print;
end loop;
Put_Line("now direct indexing: ");
for i in Base.Index range 1 .. 5 loop
declare
item : Base_Fixed5 := v(i);
begin
item.print;
end;
end loop;
end;
New_Line;
--
New_Line;
Put_Line("testing Lists.Fixed ..");
declare
lf : PLF.List(5);
begin
Put("assigning values .. ");
for i in Base.Index range 1 .. 5 loop
lf(i) := Base_Interface'Class(set_idx_fixed(i));
end loop;
Put_Line("done; values (of-loop): ");
for item of lf loop
item.print;
end loop;
Put_Line("now direct indexing: ");
for i in Base.Index range 1 .. 5 loop
declare
item : Base_Fixed5 := Base_Fixed5(lf(i).Data.all);
begin
item.print;
end;
end loop;
end;
New_Line;
--
New_Line;
Put_Line("testing Lists.Dynamic with Base_Dynamic ..");
declare
use PLDD;
ld : PLDD.List := To_Vector(5);
begin
Put("assigning values .. ");
for i in Base.Index range 1 .. 5 loop
New_Line; Put(" i="&i'Img);
ld(i) := Base_Interface'Class(set_idx_dynamic(i));
end loop;
Put_Line("done; values (of-loop): ");
for item of ld loop
item.print;
end loop;
Put_Line("now direct indexing: ");
for i in Base.Index range 1 .. 5 loop
declare
item : Base_Dynamic := Base_Dynamic(ld(i).Data.all);
begin
item.print;
end;
end loop;
end;
New_Line;
--
New_Line;
Put_Line("testing Lists.Dynamic with Base_Vector ..");
declare
use PLDV;
ld : PLDV.List := To_Vector(5);
begin
Put("assigning values .. ");
for i in Base.Index range 1 .. 5 loop
New_Line; Put(" i="&i'Img);
ld(i) := Base_Interface'Class(set_idx_vector(i)); -- this assignment of the constructed vector seems to trigger that weird storage errors
-- what's more, simply changing whitespace - adding a line-break between New_Line and Put
-- changes "heap exhausted" into "stack overflow" error..
end loop;
Put_Line("done; values (of-loop): ");
for item of ld loop
item.print;
end loop;
Put_Line("now direct indexing: ");
for i in Base.Index range 1 .. 5 loop
declare
item : Base_Vector := Base_Vector(ld(i).Data.all);
begin
item.print;
end;
end loop;
end;
New_Line;
--
end Test_List_combo;
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="14">
<syndb class_id="0" tracking_level="0" version="0">
<userIPLatency>-1</userIPLatency>
<userIPName></userIPName>
<cdfg class_id="1" tracking_level="1" version="0" object_id="_0">
<name>singleGUV</name>
<ret_bitwidth>32</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>5</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>subimg</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>subimg</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>1</if_type>
<array_size>64</array_size>
<bit_vecs class_id="7" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_2">
<Value>
<Obj>
<type>1</type>
<id>2</id>
<name>u</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>u</originalName>
<rtlName></rtlName>
<coreName></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>v</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>v</originalName>
<rtlName></rtlName>
<coreName></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="_4">
<Value>
<Obj>
<type>1</type>
<id>4</id>
<name>inv</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>inv</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<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>cosMat</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>cosMat</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>1</if_type>
<array_size>64</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
</ports>
<nodes class_id="8" tracking_level="0" version="0">
<count>79</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_6">
<Value>
<Obj>
<type>0</type>
<id>6</id>
<name>G</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>G</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>95</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_7">
<Value>
<Obj>
<type>0</type>
<id>7</id>
<name>inv_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>inv</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>97</item>
<item>98</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_8">
<Value>
<Obj>
<type>0</type>
<id>8</id>
<name>v_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>v</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>100</item>
<item>101</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_9">
<Value>
<Obj>
<type>0</type>
<id>9</id>
<name>u_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>u</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>102</item>
<item>103</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_10">
<Value>
<Obj>
<type>0</type>
<id>10</id>
<name>v_cast2_cast</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>8</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>104</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_11">
<Value>
<Obj>
<type>0</type>
<id>11</id>
<name>tmp_18</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>106</item>
<item>107</item>
<item>109</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_12">
<Value>
<Obj>
<type>0</type>
<id>12</id>
<name>tmp_19_cast</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>8</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>110</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_13">
<Value>
<Obj>
<type>0</type>
<id>13</id>
<name>u_cast1_cast</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>8</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>111</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_14">
<Value>
<Obj>
<type>0</type>
<id>14</id>
<name>tmp_19</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>112</item>
<item>113</item>
<item>114</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_15">
<Value>
<Obj>
<type>0</type>
<id>15</id>
<name>tmp_21_cast</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>8</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>115</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_16">
<Value>
<Obj>
<type>0</type>
<id>16</id>
<name>tmp</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>75</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="11" tracking_level="0" version="0">
<first>C:\Users\Venci\Videos\Project</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>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>75</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>116</item>
<item>118</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_17">
<Value>
<Obj>
<type>0</type>
<id>17</id>
<name>tmp_i</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>al</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>al</second>
</first>
<second>62</second>
</item>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>119</item>
<item>121</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_18">
<Value>
<Obj>
<type>0</type>
<id>18</id>
<name>tmp_4</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>122</item>
<item>124</item>
<item>126</item>
</oprand_edges>
<opcode>select</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_19">
<Value>
<Obj>
<type>0</type>
<id>19</id>
<name>tmp_i1</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>al</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>al</second>
</first>
<second>62</second>
</item>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</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>127</item>
<item>128</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_20">
<Value>
<Obj>
<type>0</type>
<id>20</id>
<name>tmp_6</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>129</item>
<item>131</item>
<item>133</item>
</oprand_edges>
<opcode>select</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_21">
<Value>
<Obj>
<type>0</type>
<id>21</id>
<name>tmp_7</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>134</item>
<item>135</item>
</oprand_edges>
<opcode>dmul</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_22">
<Value>
<Obj>
<type>0</type>
<id>22</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>137</item>
<item>138</item>
</oprand_edges>
<opcode>store</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_23">
<Value>
<Obj>
<type>0</type>
<id>23</id>
<name></name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>73</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>73</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>139</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_24">
<Value>
<Obj>
<type>0</type>
<id>25</id>
<name>x_assign</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>x</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>141</item>
<item>142</item>
<item>143</item>
<item>144</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_25">
<Value>
<Obj>
<type>0</type>
<id>26</id>
<name>x_assign_cast2_cast</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>73</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>73</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>145</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_26">
<Value>
<Obj>
<type>0</type>
<id>27</id>
<name>tmp_20</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>73</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>73</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>146</item>
<item>147</item>
<item>148</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_27">
<Value>
<Obj>
<type>0</type>
<id>28</id>
<name>tmp_23_cast</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>149</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_28">
<Value>
<Obj>
<type>0</type>
<id>29</id>
<name>tmp_21</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>150</item>
<item>151</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_29">
<Value>
<Obj>
<type>0</type>
<id>30</id>
<name>tmp_24_cast</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>152</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_30">
<Value>
<Obj>
<type>0</type>
<id>31</id>
<name>cosMat_addr</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>153</item>
<item>154</item>
<item>155</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_31">
<Value>
<Obj>
<type>0</type>
<id>32</id>
<name>tmp_22</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>78</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>78</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>156</item>
<item>157</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_32">
<Value>
<Obj>
<type>0</type>
<id>33</id>
<name>tmp_25_cast</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>78</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>78</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>158</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_33">
<Value>
<Obj>
<type>0</type>
<id>34</id>
<name>cosMat_addr_1</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>78</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>78</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>159</item>
<item>160</item>
<item>161</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_34">
<Value>
<Obj>
<type>0</type>
<id>35</id>
<name>exitcond1</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>73</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>73</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>162</item>
<item>164</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_35">
<Value>
<Obj>
<type>0</type>
<id>37</id>
<name>x</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>73</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>73</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>x</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>165</item>
<item>167</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_36">
<Value>
<Obj>
<type>0</type>
<id>38</id>
<name></name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>73</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>73</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>168</item>
<item>169</item>
<item>170</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_37">
<Value>
<Obj>
<type>0</type>
<id>40</id>
<name>cosMat_load</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</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>171</item>
</oprand_edges>
<opcode>load</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_38">
<Value>
<Obj>
<type>0</type>
<id>41</id>
<name>tmp_s</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</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>172</item>
</oprand_edges>
<opcode>fpext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_39">
<Value>
<Obj>
<type>0</type>
<id>42</id>
<name>tmp_i2</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>al</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>al</second>
</first>
<second>62</second>
</item>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>78</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>173</item>
<item>174</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_40">
<Value>
<Obj>
<type>0</type>
<id>43</id>
<name>tmp_2</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>78</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>78</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>175</item>
<item>176</item>
<item>177</item>
</oprand_edges>
<opcode>select</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_41">
<Value>
<Obj>
<type>0</type>
<id>44</id>
<name>cosMat_load_2</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>78</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>78</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>178</item>
</oprand_edges>
<opcode>load</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_42">
<Value>
<Obj>
<type>0</type>
<id>45</id>
<name>tmp_3</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>78</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>78</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>179</item>
</oprand_edges>
<opcode>fpext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_43">
<Value>
<Obj>
<type>0</type>
<id>46</id>
<name></name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>74</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>74</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>180</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_44">
<Value>
<Obj>
<type>0</type>
<id>48</id>
<name>x_assign_1</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>y</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>181</item>
<item>182</item>
<item>183</item>
<item>184</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_45">
<Value>
<Obj>
<type>0</type>
<id>49</id>
<name>x_assign_1_cast1_cas</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>185</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_46">
<Value>
<Obj>
<type>0</type>
<id>50</id>
<name>tmp_23</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>186</item>
<item>187</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_47">
<Value>
<Obj>
<type>0</type>
<id>51</id>
<name>tmp_26_cast</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>188</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_48">
<Value>
<Obj>
<type>0</type>
<id>52</id>
<name>subimg_addr</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>189</item>
<item>190</item>
<item>191</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_49">
<Value>
<Obj>
<type>0</type>
<id>53</id>
<name>tmp_24</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>192</item>
<item>193</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_50">
<Value>
<Obj>
<type>0</type>
<id>54</id>
<name>tmp_27_cast</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</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>194</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_51">
<Value>
<Obj>
<type>0</type>
<id>55</id>
<name>cosMat_addr_2</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>195</item>
<item>196</item>
<item>197</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_52">
<Value>
<Obj>
<type>0</type>
<id>56</id>
<name>tmp_25</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>74</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>74</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>198</item>
<item>199</item>
<item>200</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_53">
<Value>
<Obj>
<type>0</type>
<id>57</id>
<name>tmp_29_cast</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>78</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>78</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>201</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_54">
<Value>
<Obj>
<type>0</type>
<id>58</id>
<name>tmp_26</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>78</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>78</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>202</item>
<item>203</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_55">
<Value>
<Obj>
<type>0</type>
<id>59</id>
<name>tmp_30_cast</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>78</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>78</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>204</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_56">
<Value>
<Obj>
<type>0</type>
<id>60</id>
<name>cosMat_addr_3</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>78</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>78</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>205</item>
<item>206</item>
<item>207</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_57">
<Value>
<Obj>
<type>0</type>
<id>61</id>
<name>exitcond</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>74</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>74</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>208</item>
<item>209</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_58">
<Value>
<Obj>
<type>0</type>
<id>63</id>
<name>y</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>74</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>74</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>y</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>210</item>
<item>211</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_59">
<Value>
<Obj>
<type>0</type>
<id>64</id>
<name></name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>74</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>74</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>212</item>
<item>213</item>
<item>214</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_60">
<Value>
<Obj>
<type>0</type>
<id>66</id>
<name>G_load_1</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>215</item>
<item>273</item>
</oprand_edges>
<opcode>load</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_61">
<Value>
<Obj>
<type>0</type>
<id>67</id>
<name>subimg_load</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>216</item>
</oprand_edges>
<opcode>load</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_62">
<Value>
<Obj>
<type>0</type>
<id>68</id>
<name>tmp_8</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</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>217</item>
</oprand_edges>
<opcode>fpext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_63">
<Value>
<Obj>
<type>0</type>
<id>69</id>
<name>tmp_9</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>218</item>
<item>219</item>
</oprand_edges>
<opcode>dmul</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_64">
<Value>
<Obj>
<type>0</type>
<id>70</id>
<name>tmp_1</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>220</item>
<item>221</item>
</oprand_edges>
<opcode>dmul</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_65">
<Value>
<Obj>
<type>0</type>
<id>71</id>
<name>cosMat_load_1</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</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>222</item>
</oprand_edges>
<opcode>load</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_66">
<Value>
<Obj>
<type>0</type>
<id>72</id>
<name>tmp_5</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</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>223</item>
</oprand_edges>
<opcode>fpext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_67">
<Value>
<Obj>
<type>0</type>
<id>73</id>
<name>tmp_10</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>224</item>
<item>225</item>
</oprand_edges>
<opcode>dmul</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_68">
<Value>
<Obj>
<type>0</type>
<id>74</id>
<name>tmp_11</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</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>226</item>
</oprand_edges>
<opcode>fpext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_69">
<Value>
<Obj>
<type>0</type>
<id>75</id>
<name>tmp_i3</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>al</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>al</second>
</first>
<second>62</second>
</item>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>78</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>227</item>
<item>228</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_70">
<Value>
<Obj>
<type>0</type>
<id>76</id>
<name>tmp_12</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>78</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>78</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>229</item>
<item>230</item>
<item>231</item>
</oprand_edges>
<opcode>select</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_71">
<Value>
<Obj>
<type>0</type>
<id>77</id>
<name>tmp_13</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>78</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>78</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>232</item>
<item>233</item>
</oprand_edges>
<opcode>dmul</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_72">
<Value>
<Obj>
<type>0</type>
<id>78</id>
<name>tmp_14</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>78</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>78</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>234</item>
<item>235</item>
</oprand_edges>
<opcode>dmul</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_73">
<Value>
<Obj>
<type>0</type>
<id>79</id>
<name>tmp_15</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>78</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>78</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>236</item>
<item>237</item>
</oprand_edges>
<opcode>dmul</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_74">
<Value>
<Obj>
<type>0</type>
<id>80</id>
<name>cosMat_load_3</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>78</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>78</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>238</item>
</oprand_edges>
<opcode>load</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_75">
<Value>
<Obj>
<type>0</type>
<id>81</id>
<name>tmp_16</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>78</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>78</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>239</item>
</oprand_edges>
<opcode>fpext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_76">
<Value>
<Obj>
<type>0</type>
<id>82</id>
<name>tmp_17</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>78</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>78</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>240</item>
<item>241</item>
</oprand_edges>
<opcode>dmul</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_77">
<Value>
<Obj>
<type>0</type>
<id>83</id>
<name>G_2_in_v</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>75</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>75</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>242</item>
<item>243</item>
<item>244</item>
</oprand_edges>
<opcode>select</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_78">
<Value>
<Obj>
<type>0</type>
<id>84</id>
<name>G_2_in</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>245</item>
<item>246</item>
</oprand_edges>
<opcode>dadd</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_79">
<Value>
<Obj>
<type>0</type>
<id>85</id>
<name>G_1</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>G</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>247</item>
</oprand_edges>
<opcode>fptrunc</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_80">
<Value>
<Obj>
<type>0</type>
<id>86</id>
<name></name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>76</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>76</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>248</item>
<item>249</item>
<item>271</item>
<item>274</item>
</oprand_edges>
<opcode>store</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_81">
<Value>
<Obj>
<type>0</type>
<id>87</id>
<name></name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>74</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>74</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>250</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_82">
<Value>
<Obj>
<type>0</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>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>140</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_83">
<Value>
<Obj>
<type>0</type>
<id>91</id>
<name>G_load</name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>81</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>81</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>251</item>
<item>272</item>
</oprand_edges>
<opcode>load</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_84">
<Value>
<Obj>
<type>0</type>
<id>92</id>
<name></name>
<fileName>definition.cpp</fileName>
<fileDirectory>C:\Users\Venci\Videos\Project</fileDirectory>
<lineNumber>81</lineNumber>
<contextFuncName>singleGUV</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>C:\Users\Venci\Videos\Project</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>definition.cpp</first>
<second>singleGUV</second>
</first>
<second>81</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>252</item>
</oprand_edges>
<opcode>ret</opcode>
<m_Display>0</m_Display>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>11</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_85">
<Value>
<Obj>
<type>2</type>
<id>94</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_86">
<Value>
<Obj>
<type>2</type>
<id>108</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_87">
<Value>
<Obj>
<type>2</type>
<id>117</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_88">
<Value>
<Obj>
<type>2</type>
<id>120</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_89">
<Value>
<Obj>
<type>2</type>
<id>123</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>1</const_type>
<content>0.176777</content>
</item>
<item class_id_reference="16" object_id="_90">
<Value>
<Obj>
<type>2</type>
<id>125</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>1</const_type>
<content>0.25</content>
</item>
<item class_id_reference="16" object_id="_91">
<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>64</bitwidth>
</Value>
<const_type>1</const_type>
<content>0.707107</content>
</item>
<item class_id_reference="16" object_id="_92">
<Value>
<Obj>
<type>2</type>
<id>132</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>1</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_93">
<Value>
<Obj>
<type>2</type>
<id>136</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>1</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_94">
<Value>
<Obj>
<type>2</type>
<id>163</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<const_type>0</const_type>
<content>8</content>
</item>
<item class_id_reference="16" object_id="_95">
<Value>
<Obj>
<type>2</type>
<id>166</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
</consts>
<blocks class_id="17" tracking_level="0" version="0">
<count>7</count>
<item_version>0</item_version>
<item class_id="18" tracking_level="1" version="0" object_id="_96">
<Obj>
<type>3</type>
<id>24</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>18</count>
<item_version>0</item_version>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
<item>11</item>
<item>12</item>
<item>13</item>
<item>14</item>
<item>15</item>
<item>16</item>
<item>17</item>
<item>18</item>
<item>19</item>
<item>20</item>
<item>21</item>
<item>22</item>
<item>23</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_97">
<Obj>
<type>3</type>
<id>39</id>
<name>.loopexit</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>13</count>
<item_version>0</item_version>
<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>37</item>
<item>38</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_98">
<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>7</count>
<item_version>0</item_version>
<item>40</item>
<item>41</item>
<item>42</item>
<item>43</item>
<item>44</item>
<item>45</item>
<item>46</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_99">
<Obj>
<type>3</type>
<id>65</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>16</count>
<item_version>0</item_version>
<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>63</item>
<item>64</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_100">
<Obj>
<type>3</type>
<id>88</id>
<name>_ifconv</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>22</count>
<item_version>0</item_version>
<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>
</node_objs>
</item>
<item class_id_reference="18" object_id="_101">
<Obj>
<type>3</type>
<id>90</id>
<name>.loopexit.loopexit</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>89</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_102">
<Obj>
<type>3</type>
<id>93</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>91</item>
<item>92</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>150</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_103">
<id>95</id>
<edge_type>1</edge_type>
<source_obj>94</source_obj>
<sink_obj>6</sink_obj>
</item>
<item class_id_reference="20" object_id="_104">
<id>98</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>7</sink_obj>
</item>
<item class_id_reference="20" object_id="_105">
<id>101</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>8</sink_obj>
</item>
<item class_id_reference="20" object_id="_106">
<id>103</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>9</sink_obj>
</item>
<item class_id_reference="20" object_id="_107">
<id>104</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>10</sink_obj>
</item>
<item class_id_reference="20" object_id="_108">
<id>107</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>11</sink_obj>
</item>
<item class_id_reference="20" object_id="_109">
<id>109</id>
<edge_type>1</edge_type>
<source_obj>108</source_obj>
<sink_obj>11</sink_obj>
</item>
<item class_id_reference="20" object_id="_110">
<id>110</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>12</sink_obj>
</item>
<item class_id_reference="20" object_id="_111">
<id>111</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>13</sink_obj>
</item>
<item class_id_reference="20" object_id="_112">
<id>113</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>14</sink_obj>
</item>
<item class_id_reference="20" object_id="_113">
<id>114</id>
<edge_type>1</edge_type>
<source_obj>108</source_obj>
<sink_obj>14</sink_obj>
</item>
<item class_id_reference="20" object_id="_114">
<id>115</id>
<edge_type>1</edge_type>
<source_obj>14</source_obj>
<sink_obj>15</sink_obj>
</item>
<item class_id_reference="20" object_id="_115">
<id>116</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>16</sink_obj>
</item>
<item class_id_reference="20" object_id="_116">
<id>118</id>
<edge_type>1</edge_type>
<source_obj>117</source_obj>
<sink_obj>16</sink_obj>
</item>
<item class_id_reference="20" object_id="_117">
<id>119</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>17</sink_obj>
</item>
<item class_id_reference="20" object_id="_118">
<id>121</id>
<edge_type>1</edge_type>
<source_obj>120</source_obj>
<sink_obj>17</sink_obj>
</item>
<item class_id_reference="20" object_id="_119">
<id>122</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>18</sink_obj>
</item>
<item class_id_reference="20" object_id="_120">
<id>124</id>
<edge_type>1</edge_type>
<source_obj>123</source_obj>
<sink_obj>18</sink_obj>
</item>
<item class_id_reference="20" object_id="_121">
<id>126</id>
<edge_type>1</edge_type>
<source_obj>125</source_obj>
<sink_obj>18</sink_obj>
</item>
<item class_id_reference="20" object_id="_122">
<id>127</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>19</sink_obj>
</item>
<item class_id_reference="20" object_id="_123">
<id>128</id>
<edge_type>1</edge_type>
<source_obj>120</source_obj>
<sink_obj>19</sink_obj>
</item>
<item class_id_reference="20" object_id="_124">
<id>129</id>
<edge_type>1</edge_type>
<source_obj>19</source_obj>
<sink_obj>20</sink_obj>
</item>
<item class_id_reference="20" object_id="_125">
<id>131</id>
<edge_type>1</edge_type>
<source_obj>130</source_obj>
<sink_obj>20</sink_obj>
</item>
<item class_id_reference="20" object_id="_126">
<id>133</id>
<edge_type>1</edge_type>
<source_obj>132</source_obj>
<sink_obj>20</sink_obj>
</item>
<item class_id_reference="20" object_id="_127">
<id>134</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="20" object_id="_128">
<id>135</id>
<edge_type>1</edge_type>
<source_obj>20</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="20" object_id="_129">
<id>137</id>
<edge_type>1</edge_type>
<source_obj>136</source_obj>
<sink_obj>22</sink_obj>
</item>
<item class_id_reference="20" object_id="_130">
<id>138</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>22</sink_obj>
</item>
<item class_id_reference="20" object_id="_131">
<id>139</id>
<edge_type>2</edge_type>
<source_obj>39</source_obj>
<sink_obj>23</sink_obj>
</item>
<item class_id_reference="20" object_id="_132">
<id>140</id>
<edge_type>2</edge_type>
<source_obj>39</source_obj>
<sink_obj>89</sink_obj>
</item>
<item class_id_reference="20" object_id="_133">
<id>141</id>
<edge_type>1</edge_type>
<source_obj>120</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_134">
<id>142</id>
<edge_type>2</edge_type>
<source_obj>24</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_135">
<id>143</id>
<edge_type>1</edge_type>
<source_obj>37</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_136">
<id>144</id>
<edge_type>2</edge_type>
<source_obj>90</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_137">
<id>145</id>
<edge_type>1</edge_type>
<source_obj>25</source_obj>
<sink_obj>26</sink_obj>
</item>
<item class_id_reference="20" object_id="_138">
<id>147</id>
<edge_type>1</edge_type>
<source_obj>25</source_obj>
<sink_obj>27</sink_obj>
</item>
<item class_id_reference="20" object_id="_139">
<id>148</id>
<edge_type>1</edge_type>
<source_obj>108</source_obj>
<sink_obj>27</sink_obj>
</item>
<item class_id_reference="20" object_id="_140">
<id>149</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>28</sink_obj>
</item>
<item class_id_reference="20" object_id="_141">
<id>150</id>
<edge_type>1</edge_type>
<source_obj>26</source_obj>
<sink_obj>29</sink_obj>
</item>
<item class_id_reference="20" object_id="_142">
<id>151</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>29</sink_obj>
</item>
<item class_id_reference="20" object_id="_143">
<id>152</id>
<edge_type>1</edge_type>
<source_obj>29</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="20" object_id="_144">
<id>153</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>31</sink_obj>
</item>
<item class_id_reference="20" object_id="_145">
<id>154</id>
<edge_type>1</edge_type>
<source_obj>117</source_obj>
<sink_obj>31</sink_obj>
</item>
<item class_id_reference="20" object_id="_146">
<id>155</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>31</sink_obj>
</item>
<item class_id_reference="20" object_id="_147">
<id>156</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>32</sink_obj>
</item>
<item class_id_reference="20" object_id="_148">
<id>157</id>
<edge_type>1</edge_type>
<source_obj>28</source_obj>
<sink_obj>32</sink_obj>
</item>
<item class_id_reference="20" object_id="_149">
<id>158</id>
<edge_type>1</edge_type>
<source_obj>32</source_obj>
<sink_obj>33</sink_obj>
</item>
<item class_id_reference="20" object_id="_150">
<id>159</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>34</sink_obj>
</item>
<item class_id_reference="20" object_id="_151">
<id>160</id>
<edge_type>1</edge_type>
<source_obj>117</source_obj>
<sink_obj>34</sink_obj>
</item>
<item class_id_reference="20" object_id="_152">
<id>161</id>
<edge_type>1</edge_type>
<source_obj>33</source_obj>
<sink_obj>34</sink_obj>
</item>
<item class_id_reference="20" object_id="_153">
<id>162</id>
<edge_type>1</edge_type>
<source_obj>25</source_obj>
<sink_obj>35</sink_obj>
</item>
<item class_id_reference="20" object_id="_154">
<id>164</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>35</sink_obj>
</item>
<item class_id_reference="20" object_id="_155">
<id>165</id>
<edge_type>1</edge_type>
<source_obj>25</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_156">
<id>167</id>
<edge_type>1</edge_type>
<source_obj>166</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_157">
<id>168</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>38</sink_obj>
</item>
<item class_id_reference="20" object_id="_158">
<id>169</id>
<edge_type>2</edge_type>
<source_obj>47</source_obj>
<sink_obj>38</sink_obj>
</item>
<item class_id_reference="20" object_id="_159">
<id>170</id>
<edge_type>2</edge_type>
<source_obj>93</source_obj>
<sink_obj>38</sink_obj>
</item>
<item class_id_reference="20" object_id="_160">
<id>171</id>
<edge_type>1</edge_type>
<source_obj>31</source_obj>
<sink_obj>40</sink_obj>
</item>
<item class_id_reference="20" object_id="_161">
<id>172</id>
<edge_type>1</edge_type>
<source_obj>40</source_obj>
<sink_obj>41</sink_obj>
</item>
<item class_id_reference="20" object_id="_162">
<id>173</id>
<edge_type>1</edge_type>
<source_obj>25</source_obj>
<sink_obj>42</sink_obj>
</item>
<item class_id_reference="20" object_id="_163">
<id>174</id>
<edge_type>1</edge_type>
<source_obj>120</source_obj>
<sink_obj>42</sink_obj>
</item>
<item class_id_reference="20" object_id="_164">
<id>175</id>
<edge_type>1</edge_type>
<source_obj>42</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_165">
<id>176</id>
<edge_type>1</edge_type>
<source_obj>123</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_166">
<id>177</id>
<edge_type>1</edge_type>
<source_obj>125</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_167">
<id>178</id>
<edge_type>1</edge_type>
<source_obj>34</source_obj>
<sink_obj>44</sink_obj>
</item>
<item class_id_reference="20" object_id="_168">
<id>179</id>
<edge_type>1</edge_type>
<source_obj>44</source_obj>
<sink_obj>45</sink_obj>
</item>
<item class_id_reference="20" object_id="_169">
<id>180</id>
<edge_type>2</edge_type>
<source_obj>65</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_170">
<id>181</id>
<edge_type>1</edge_type>
<source_obj>63</source_obj>
<sink_obj>48</sink_obj>
</item>
<item class_id_reference="20" object_id="_171">
<id>182</id>
<edge_type>2</edge_type>
<source_obj>88</source_obj>
<sink_obj>48</sink_obj>
</item>
<item class_id_reference="20" object_id="_172">
<id>183</id>
<edge_type>1</edge_type>
<source_obj>120</source_obj>
<sink_obj>48</sink_obj>
</item>
<item class_id_reference="20" object_id="_173">
<id>184</id>
<edge_type>2</edge_type>
<source_obj>47</source_obj>
<sink_obj>48</sink_obj>
</item>
<item class_id_reference="20" object_id="_174">
<id>185</id>
<edge_type>1</edge_type>
<source_obj>48</source_obj>
<sink_obj>49</sink_obj>
</item>
<item class_id_reference="20" object_id="_175">
<id>186</id>
<edge_type>1</edge_type>
<source_obj>49</source_obj>
<sink_obj>50</sink_obj>
</item>
<item class_id_reference="20" object_id="_176">
<id>187</id>
<edge_type>1</edge_type>
<source_obj>28</source_obj>
<sink_obj>50</sink_obj>
</item>
<item class_id_reference="20" object_id="_177">
<id>188</id>
<edge_type>1</edge_type>
<source_obj>50</source_obj>
<sink_obj>51</sink_obj>
</item>
<item class_id_reference="20" object_id="_178">
<id>189</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>52</sink_obj>
</item>
<item class_id_reference="20" object_id="_179">
<id>190</id>
<edge_type>1</edge_type>
<source_obj>117</source_obj>
<sink_obj>52</sink_obj>
</item>
<item class_id_reference="20" object_id="_180">
<id>191</id>
<edge_type>1</edge_type>
<source_obj>51</source_obj>
<sink_obj>52</sink_obj>
</item>
<item class_id_reference="20" object_id="_181">
<id>192</id>
<edge_type>1</edge_type>
<source_obj>49</source_obj>
<sink_obj>53</sink_obj>
</item>
<item class_id_reference="20" object_id="_182">
<id>193</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>53</sink_obj>
</item>
<item class_id_reference="20" object_id="_183">
<id>194</id>
<edge_type>1</edge_type>
<source_obj>53</source_obj>
<sink_obj>54</sink_obj>
</item>
<item class_id_reference="20" object_id="_184">
<id>195</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>55</sink_obj>
</item>
<item class_id_reference="20" object_id="_185">
<id>196</id>
<edge_type>1</edge_type>
<source_obj>117</source_obj>
<sink_obj>55</sink_obj>
</item>
<item class_id_reference="20" object_id="_186">
<id>197</id>
<edge_type>1</edge_type>
<source_obj>54</source_obj>
<sink_obj>55</sink_obj>
</item>
<item class_id_reference="20" object_id="_187">
<id>199</id>
<edge_type>1</edge_type>
<source_obj>48</source_obj>
<sink_obj>56</sink_obj>
</item>
<item class_id_reference="20" object_id="_188">
<id>200</id>
<edge_type>1</edge_type>
<source_obj>108</source_obj>
<sink_obj>56</sink_obj>
</item>
<item class_id_reference="20" object_id="_189">
<id>201</id>
<edge_type>1</edge_type>
<source_obj>56</source_obj>
<sink_obj>57</sink_obj>
</item>
<item class_id_reference="20" object_id="_190">
<id>202</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>58</sink_obj>
</item>
<item class_id_reference="20" object_id="_191">
<id>203</id>
<edge_type>1</edge_type>
<source_obj>57</source_obj>
<sink_obj>58</sink_obj>
</item>
<item class_id_reference="20" object_id="_192">
<id>204</id>
<edge_type>1</edge_type>
<source_obj>58</source_obj>
<sink_obj>59</sink_obj>
</item>
<item class_id_reference="20" object_id="_193">
<id>205</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>60</sink_obj>
</item>
<item class_id_reference="20" object_id="_194">
<id>206</id>
<edge_type>1</edge_type>
<source_obj>117</source_obj>
<sink_obj>60</sink_obj>
</item>
<item class_id_reference="20" object_id="_195">
<id>207</id>
<edge_type>1</edge_type>
<source_obj>59</source_obj>
<sink_obj>60</sink_obj>
</item>
<item class_id_reference="20" object_id="_196">
<id>208</id>
<edge_type>1</edge_type>
<source_obj>48</source_obj>
<sink_obj>61</sink_obj>
</item>
<item class_id_reference="20" object_id="_197">
<id>209</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>61</sink_obj>
</item>
<item class_id_reference="20" object_id="_198">
<id>210</id>
<edge_type>1</edge_type>
<source_obj>48</source_obj>
<sink_obj>63</sink_obj>
</item>
<item class_id_reference="20" object_id="_199">
<id>211</id>
<edge_type>1</edge_type>
<source_obj>166</source_obj>
<sink_obj>63</sink_obj>
</item>
<item class_id_reference="20" object_id="_200">
<id>212</id>
<edge_type>1</edge_type>
<source_obj>61</source_obj>
<sink_obj>64</sink_obj>
</item>
<item class_id_reference="20" object_id="_201">
<id>213</id>
<edge_type>2</edge_type>
<source_obj>88</source_obj>
<sink_obj>64</sink_obj>
</item>
<item class_id_reference="20" object_id="_202">
<id>214</id>
<edge_type>2</edge_type>
<source_obj>90</source_obj>
<sink_obj>64</sink_obj>
</item>
<item class_id_reference="20" object_id="_203">
<id>215</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>66</sink_obj>
</item>
<item class_id_reference="20" object_id="_204">
<id>216</id>
<edge_type>1</edge_type>
<source_obj>52</source_obj>
<sink_obj>67</sink_obj>
</item>
<item class_id_reference="20" object_id="_205">
<id>217</id>
<edge_type>1</edge_type>
<source_obj>67</source_obj>
<sink_obj>68</sink_obj>
</item>
<item class_id_reference="20" object_id="_206">
<id>218</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>69</sink_obj>
</item>
<item class_id_reference="20" object_id="_207">
<id>219</id>
<edge_type>1</edge_type>
<source_obj>68</source_obj>
<sink_obj>69</sink_obj>
</item>
<item class_id_reference="20" object_id="_208">
<id>220</id>
<edge_type>1</edge_type>
<source_obj>69</source_obj>
<sink_obj>70</sink_obj>
</item>
<item class_id_reference="20" object_id="_209">
<id>221</id>
<edge_type>1</edge_type>
<source_obj>41</source_obj>
<sink_obj>70</sink_obj>
</item>
<item class_id_reference="20" object_id="_210">
<id>222</id>
<edge_type>1</edge_type>
<source_obj>55</source_obj>
<sink_obj>71</sink_obj>
</item>
<item class_id_reference="20" object_id="_211">
<id>223</id>
<edge_type>1</edge_type>
<source_obj>71</source_obj>
<sink_obj>72</sink_obj>
</item>
<item class_id_reference="20" object_id="_212">
<id>224</id>
<edge_type>1</edge_type>
<source_obj>70</source_obj>
<sink_obj>73</sink_obj>
</item>
<item class_id_reference="20" object_id="_213">
<id>225</id>
<edge_type>1</edge_type>
<source_obj>72</source_obj>
<sink_obj>73</sink_obj>
</item>
<item class_id_reference="20" object_id="_214">
<id>226</id>
<edge_type>1</edge_type>
<source_obj>66</source_obj>
<sink_obj>74</sink_obj>
</item>
<item class_id_reference="20" object_id="_215">
<id>227</id>
<edge_type>1</edge_type>
<source_obj>48</source_obj>
<sink_obj>75</sink_obj>
</item>
<item class_id_reference="20" object_id="_216">
<id>228</id>
<edge_type>1</edge_type>
<source_obj>120</source_obj>
<sink_obj>75</sink_obj>
</item>
<item class_id_reference="20" object_id="_217">
<id>229</id>
<edge_type>1</edge_type>
<source_obj>75</source_obj>
<sink_obj>76</sink_obj>
</item>
<item class_id_reference="20" object_id="_218">
<id>230</id>
<edge_type>1</edge_type>
<source_obj>130</source_obj>
<sink_obj>76</sink_obj>
</item>
<item class_id_reference="20" object_id="_219">
<id>231</id>
<edge_type>1</edge_type>
<source_obj>132</source_obj>
<sink_obj>76</sink_obj>
</item>
<item class_id_reference="20" object_id="_220">
<id>232</id>
<edge_type>1</edge_type>
<source_obj>43</source_obj>
<sink_obj>77</sink_obj>
</item>
<item class_id_reference="20" object_id="_221">
<id>233</id>
<edge_type>1</edge_type>
<source_obj>76</source_obj>
<sink_obj>77</sink_obj>
</item>
<item class_id_reference="20" object_id="_222">
<id>234</id>
<edge_type>1</edge_type>
<source_obj>77</source_obj>
<sink_obj>78</sink_obj>
</item>
<item class_id_reference="20" object_id="_223">
<id>235</id>
<edge_type>1</edge_type>
<source_obj>68</source_obj>
<sink_obj>78</sink_obj>
</item>
<item class_id_reference="20" object_id="_224">
<id>236</id>
<edge_type>1</edge_type>
<source_obj>78</source_obj>
<sink_obj>79</sink_obj>
</item>
<item class_id_reference="20" object_id="_225">
<id>237</id>
<edge_type>1</edge_type>
<source_obj>45</source_obj>
<sink_obj>79</sink_obj>
</item>
<item class_id_reference="20" object_id="_226">
<id>238</id>
<edge_type>1</edge_type>
<source_obj>60</source_obj>
<sink_obj>80</sink_obj>
</item>
<item class_id_reference="20" object_id="_227">
<id>239</id>
<edge_type>1</edge_type>
<source_obj>80</source_obj>
<sink_obj>81</sink_obj>
</item>
<item class_id_reference="20" object_id="_228">
<id>240</id>
<edge_type>1</edge_type>
<source_obj>79</source_obj>
<sink_obj>82</sink_obj>
</item>
<item class_id_reference="20" object_id="_229">
<id>241</id>
<edge_type>1</edge_type>
<source_obj>81</source_obj>
<sink_obj>82</sink_obj>
</item>
<item class_id_reference="20" object_id="_230">
<id>242</id>
<edge_type>1</edge_type>
<source_obj>16</source_obj>
<sink_obj>83</sink_obj>
</item>
<item class_id_reference="20" object_id="_231">
<id>243</id>
<edge_type>1</edge_type>
<source_obj>73</source_obj>
<sink_obj>83</sink_obj>
</item>
<item class_id_reference="20" object_id="_232">
<id>244</id>
<edge_type>1</edge_type>
<source_obj>82</source_obj>
<sink_obj>83</sink_obj>
</item>
<item class_id_reference="20" object_id="_233">
<id>245</id>
<edge_type>1</edge_type>
<source_obj>74</source_obj>
<sink_obj>84</sink_obj>
</item>
<item class_id_reference="20" object_id="_234">
<id>246</id>
<edge_type>1</edge_type>
<source_obj>83</source_obj>
<sink_obj>84</sink_obj>
</item>
<item class_id_reference="20" object_id="_235">
<id>247</id>
<edge_type>1</edge_type>
<source_obj>84</source_obj>
<sink_obj>85</sink_obj>
</item>
<item class_id_reference="20" object_id="_236">
<id>248</id>
<edge_type>1</edge_type>
<source_obj>85</source_obj>
<sink_obj>86</sink_obj>
</item>
<item class_id_reference="20" object_id="_237">
<id>249</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>86</sink_obj>
</item>
<item class_id_reference="20" object_id="_238">
<id>250</id>
<edge_type>2</edge_type>
<source_obj>65</source_obj>
<sink_obj>87</sink_obj>
</item>
<item class_id_reference="20" object_id="_239">
<id>251</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>91</sink_obj>
</item>
<item class_id_reference="20" object_id="_240">
<id>252</id>
<edge_type>1</edge_type>
<source_obj>91</source_obj>
<sink_obj>92</sink_obj>
</item>
<item class_id_reference="20" object_id="_241">
<id>263</id>
<edge_type>2</edge_type>
<source_obj>24</source_obj>
<sink_obj>39</sink_obj>
</item>
<item class_id_reference="20" object_id="_242">
<id>264</id>
<edge_type>2</edge_type>
<source_obj>39</source_obj>
<sink_obj>93</sink_obj>
</item>
<item class_id_reference="20" object_id="_243">
<id>265</id>
<edge_type>2</edge_type>
<source_obj>39</source_obj>
<sink_obj>47</sink_obj>
</item>
<item class_id_reference="20" object_id="_244">
<id>266</id>
<edge_type>2</edge_type>
<source_obj>47</source_obj>
<sink_obj>65</sink_obj>
</item>
<item class_id_reference="20" object_id="_245">
<id>267</id>
<edge_type>2</edge_type>
<source_obj>65</source_obj>
<sink_obj>90</sink_obj>
</item>
<item class_id_reference="20" object_id="_246">
<id>268</id>
<edge_type>2</edge_type>
<source_obj>65</source_obj>
<sink_obj>88</sink_obj>
</item>
<item class_id_reference="20" object_id="_247">
<id>269</id>
<edge_type>2</edge_type>
<source_obj>88</source_obj>
<sink_obj>65</sink_obj>
</item>
<item class_id_reference="20" object_id="_248">
<id>270</id>
<edge_type>2</edge_type>
<source_obj>90</source_obj>
<sink_obj>39</sink_obj>
</item>
<item class_id_reference="20" object_id="_249">
<id>271</id>
<edge_type>4</edge_type>
<source_obj>66</source_obj>
<sink_obj>86</sink_obj>
</item>
<item class_id_reference="20" object_id="_250">
<id>272</id>
<edge_type>4</edge_type>
<source_obj>22</source_obj>
<sink_obj>91</sink_obj>
</item>
<item class_id_reference="20" object_id="_251">
<id>273</id>
<edge_type>4</edge_type>
<source_obj>22</source_obj>
<sink_obj>66</sink_obj>
</item>
<item class_id_reference="20" object_id="_252">
<id>274</id>
<edge_type>4</edge_type>
<source_obj>22</source_obj>
<sink_obj>86</sink_obj>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="21" tracking_level="0" version="0">
<count>7</count>
<item_version>0</item_version>
<item class_id="22" tracking_level="1" version="0" object_id="_253">
<mId>1</mId>
<mTag>singleGUV</mTag>
<mType>0</mType>
<sub_regions>
<count>3</count>
<item_version>0</item_version>
<item>2</item>
<item>3</item>
<item>7</item>
</sub_regions>
<basic_blocks>
<count>0</count>
<item_version>0</item_version>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>1437</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_254">
<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>24</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>4</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_255">
<mId>3</mId>
<mTag>Loop 1</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>8</mMinTripCount>
<mMaxTripCount>8</mMaxTripCount>
<mMinLatency>1432</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_256">
<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>39</item>
<item>47</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>1</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_257">
<mId>5</mId>
<mTag>Loop 1.1</mTag>
<mType>1</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>2</count>
<item_version>0</item_version>
<item>65</item>
<item>88</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>8</mMinTripCount>
<mMaxTripCount>8</mMaxTripCount>
<mMinLatency>176</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_258">
<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>90</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_259">
<mId>7</mId>
<mTag>Return</mTag>
<mType>0</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>93</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
</cdfg_regions>
<fsm class_id="-1"></fsm>
<res class_id="-1"></res>
<node_label_latency class_id="26" tracking_level="0" version="0">
<count>79</count>
<item_version>0</item_version>
<item class_id="27" tracking_level="0" version="0">
<first>6</first>
<second class_id="28" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>7</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>8</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>9</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>10</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>11</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>12</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>13</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>14</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>15</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>16</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>17</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>18</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>19</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>20</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>21</first>
<second>
<first>1</first>
<second>3</second>
</second>
</item>
<item>
<first>22</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>23</first>
<second>
<first>4</first>
<second>0</second>
</second>
</item>
<item>
<first>25</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>26</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>27</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>28</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>29</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>30</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>31</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>32</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>33</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>34</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>35</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>37</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>38</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>40</first>
<second>
<first>5</first>
<second>1</second>
</second>
</item>
<item>
<first>41</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>42</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>43</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>44</first>
<second>
<first>5</first>
<second>1</second>
</second>
</item>
<item>
<first>45</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>46</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
<item>
<first>48</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>49</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>50</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>51</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>52</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>53</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>54</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>55</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>56</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>57</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>58</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>59</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>60</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>61</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>63</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>64</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>66</first>
<second>
<first>23</first>
<second>0</second>
</second>
</item>
<item>
<first>67</first>
<second>
<first>7</first>
<second>1</second>
</second>
</item>
<item>
<first>68</first>
<second>
<first>8</first>
<second>0</second>
</second>
</item>
<item>
<first>69</first>
<second>
<first>9</first>
<second>3</second>
</second>
</item>
<item>
<first>70</first>
<second>
<first>13</first>
<second>3</second>
</second>
</item>
<item>
<first>71</first>
<second>
<first>15</first>
<second>1</second>
</second>
</item>
<item>
<first>72</first>
<second>
<first>16</first>
<second>0</second>
</second>
</item>
<item>
<first>73</first>
<second>
<first>17</first>
<second>3</second>
</second>
</item>
<item>
<first>74</first>
<second>
<first>23</first>
<second>0</second>
</second>
</item>
<item>
<first>75</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>76</first>
<second>
<first>8</first>
<second>0</second>
</second>
</item>
<item>
<first>77</first>
<second>
<first>8</first>
<second>3</second>
</second>
</item>
<item>
<first>78</first>
<second>
<first>12</first>
<second>3</second>
</second>
</item>
<item>
<first>79</first>
<second>
<first>16</first>
<second>3</second>
</second>
</item>
<item>
<first>80</first>
<second>
<first>18</first>
<second>1</second>
</second>
</item>
<item>
<first>81</first>
<second>
<first>19</first>
<second>0</second>
</second>
</item>
<item>
<first>82</first>
<second>
<first>20</first>
<second>3</second>
</second>
</item>
<item>
<first>83</first>
<second>
<first>23</first>
<second>0</second>
</second>
</item>
<item>
<first>84</first>
<second>
<first>24</first>
<second>3</second>
</second>
</item>
<item>
<first>85</first>
<second>
<first>28</first>
<second>0</second>
</second>
</item>
<item>
<first>86</first>
<second>
<first>28</first>
<second>0</second>
</second>
</item>
<item>
<first>87</first>
<second>
<first>28</first>
<second>0</second>
</second>
</item>
<item>
<first>89</first>
<second>
<first>7</first>
<second>0</second>
</second>
</item>
<item>
<first>91</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
<item>
<first>92</first>
<second>
<first>5</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="29" tracking_level="0" version="0">
<count>7</count>
<item_version>0</item_version>
<item class_id="30" tracking_level="0" version="0">
<first>24</first>
<second class_id="31" tracking_level="0" version="0">
<first>0</first>
<second>4</second>
</second>
</item>
<item>
<first>39</first>
<second>
<first>5</first>
<second>5</second>
</second>
</item>
<item>
<first>47</first>
<second>
<first>5</first>
<second>6</second>
</second>
</item>
<item>
<first>65</first>
<second>
<first>7</first>
<second>7</second>
</second>
</item>
<item>
<first>88</first>
<second>
<first>7</first>
<second>28</second>
</second>
</item>
<item>
<first>90</first>
<second>
<first>7</first>
<second>7</second>
</second>
</item>
<item>
<first>93</first>
<second>
<first>5</first>
<second>5</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="32" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</regions>
<dp_fu_nodes class_id="33" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="34" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_module>
<dp_fu_nodes_io>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_io>
<return_ports>
<count>0</count>
<item_version>0</item_version>
</return_ports>
<dp_mem_port_nodes class_id="35" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>0</count>
<item_version>0</item_version>
</dp_reg_nodes>
<dp_regname_nodes>
<count>0</count>
<item_version>0</item_version>
</dp_regname_nodes>
<dp_reg_phi>
<count>0</count>
<item_version>0</item_version>
</dp_reg_phi>
<dp_regname_phi>
<count>0</count>
<item_version>0</item_version>
</dp_regname_phi>
<dp_port_io_nodes class_id="36" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_port_io_nodes>
<port2core class_id="37" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</port2core>
<node2core>
<count>0</count>
<item_version>0</item_version>
</node2core>
</syndb>
</boost_serialization>
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . T A S K _ I N F O --
-- --
-- B o d y --
-- (Compiler Interface) --
-- --
-- Copyright (C) 1998-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This is a dummy version of this package that is needed to solve bootstrap
-- problems when compiling a library that doesn't require s-tasinf.adb from
-- a compiler that contains one.
-- This package contains the definitions and routines associated with the
-- implementation of the Task_Info pragma.
package body System.Task_Info is
end System.Task_Info;
|
with
openGL.Geometry.lit_colored,
openGL.Primitive.indexed;
package body openGL.Model.polygon.lit_colored
is
function new_Polygon (Vertices : in Vector_2_array;
Color : in lucid_Color) return View
is
Self : constant View := new Item;
begin
Self.Color := Color;
Self.Vertices (Vertices'Range) := Vertices;
Self.vertex_Count := Vertices'Length;
Self.define (Scale => (1.0, 1.0, 1.0));
return Self;
end new_Polygon;
type Geometry_view is access all Geometry.lit_colored.item'Class;
-- NB: - An extra vertex is required at the end of each latitude ring.
-- - This last vertex has the same site as the rings initial vertex.
-- - The last vertex has 's' texture coord of 1.0, whereas
-- the initial vertex has 's' texture coord of 0.0.
--
overriding
function to_GL_Geometries (Self : access Item; Textures : access Texture.name_Map_of_texture'Class;
Fonts : in Font.font_id_Map_of_font) return Geometry.views
is
pragma unreferenced (Textures, Fonts);
use Geometry,
Geometry.lit_colored;
vertex_Count : constant Index_t := Index_t (Self.vertex_Count);
indices_Count : constant long_Index_t := long_Index_t (Self.vertex_Count);
the_Vertices : aliased Geometry.lit_colored.Vertex_array := (1 .. vertex_Count => <>);
the_Indices : aliased Indices := (1 .. indices_Count => <>);
the_Geometry : constant Geometry_view := Geometry.lit_colored.new_Geometry;
begin
set_Vertices:
begin
for i in 1 .. vertex_Count
loop
the_Vertices (i).Site := Vector_3 (Self.Vertices (Integer (i)) & 0.0);
the_Vertices (i).Normal := (0.0, 0.0, 1.0);
the_Vertices (i).Color := Self.Color;
end loop;
end set_Vertices;
--- Set Indices.
--
for i in the_Indices'Range
loop
the_Indices (i) := Index_t (i);
end loop;
the_Geometry.is_Transparent (False);
the_Geometry.Vertices_are (the_Vertices);
declare
the_Primitive : constant Primitive.indexed.view
:= Primitive.indexed.new_Primitive (Primitive.triangle_Fan,
the_Indices);
begin
the_Geometry.add (Primitive.view (the_Primitive));
end;
return (1 => Geometry.view (the_Geometry));
end to_GL_Geometries;
end openGL.Model.polygon.lit_colored;
|
pragma Ada_2005;
pragma Style_Checks (Off);
pragma Warnings (Off);
with Interfaces.C; use Interfaces.C;
limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstelement_h;
limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h;
limited with GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h;
package GStreamer.GST_Low_Level.gstreamer_0_10_gst_check_gstbufferstraw_h is
-- GStreamer
-- *
-- * Copyright (C) 2006 Andy Wingo <wingo at pobox.com>
-- *
-- * This library is free software; you can redistribute it and/or
-- * modify it under the terms of the GNU Library General Public
-- * License as published by the Free Software Foundation; either
-- * version 2 of the License, 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
-- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- * Library General Public License for more details.
-- *
-- * You should have received a copy of the GNU Library General Public
-- * License along with this library; if not, write to the
-- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-- * Boston, MA 02111-1307, USA.
--
procedure gst_buffer_straw_start_pipeline (bin : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstelement_h.GstElement; pad : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstPad); -- gst/check/gstbufferstraw.h:29
pragma Import (C, gst_buffer_straw_start_pipeline, "gst_buffer_straw_start_pipeline");
function gst_buffer_straw_get_buffer (bin : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstelement_h.GstElement; pad : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstPad) return access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstbuffer_h.GstBuffer; -- gst/check/gstbufferstraw.h:30
pragma Import (C, gst_buffer_straw_get_buffer, "gst_buffer_straw_get_buffer");
procedure gst_buffer_straw_stop_pipeline (bin : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstelement_h.GstElement; pad : access GStreamer.GST_Low_Level.gstreamer_0_10_gst_gstpad_h.GstPad); -- gst/check/gstbufferstraw.h:31
pragma Import (C, gst_buffer_straw_stop_pipeline, "gst_buffer_straw_stop_pipeline");
end GStreamer.GST_Low_Level.gstreamer_0_10_gst_check_gstbufferstraw_h;
|
with STM32_SVD; use STM32_SVD;
package STM32GD.USART is
pragma Preelaborate;
type USART_Data is array (Natural range <>) of Byte;
end STM32GD.USART;
|
-----------------------------------------------------------------------
-- util-log-appenders-consoles -- Console log appenders
-- Copyright (C) 2001 - 2019, 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.
-----------------------------------------------------------------------
with Ada.Text_IO;
with Util.Beans.Objects;
with Util.Properties.Basic;
with Util.Log.Appenders.Formatter;
package body Util.Log.Appenders.Consoles is
use Ada;
overriding
procedure Append (Self : in out Console_Appender;
Message : in Util.Strings.Builders.Builder;
Date : in Ada.Calendar.Time;
Level : in Level_Type;
Logger : in String) is
procedure Write_Standard_Output (Data : in String) with Inline_Always;
procedure Write_Standard_Error (Data : in String) with Inline_Always;
procedure Write_Standard_Output (Data : in String) is
begin
-- Don't use Text_IO.Standard_Output so that we honor the Set_Output definition.
Text_IO.Put (Data);
end Write_Standard_Output;
procedure Write_Standard_Error (Data : in String) is
begin
Text_IO.Put (Text_IO.Current_Error, Data);
end Write_Standard_Error;
procedure Write_Output is new Formatter (Write_Standard_Output);
procedure Write_Error is new Formatter (Write_Standard_Error);
begin
if Self.Level >= Level then
if Self.Stderr then
if not Util.Beans.Objects.Is_Null (Self.Prefix) then
Text_IO.Put (Text_IO.Current_Error,
Util.Beans.Objects.To_String (Self.Prefix));
end if;
Write_Error (Self, Message, Date, Level, Logger);
Text_IO.New_Line (Text_IO.Current_Error);
else
Write_Output (Self, Message, Date, Level, Logger);
Text_IO.New_Line;
end if;
end if;
end Append;
-- ------------------------------
-- Flush the log events.
-- ------------------------------
overriding
procedure Flush (Self : in out Console_Appender) is
begin
if Self.Stderr then
Text_IO.Flush (Text_IO.Current_Error);
else
Text_IO.Flush;
end if;
end Flush;
-- ------------------------------
-- Create a console appender and configure it according to the properties
-- ------------------------------
function Create (Name : in String;
Properties : in Util.Properties.Manager;
Default : in Level_Type)
return Appender_Access is
use Util.Properties.Basic;
Result : constant Console_Appender_Access
:= new Console_Appender '(Finalization.Limited_Controlled with Length => Name'Length,
Name => Name,
others => <>);
begin
Result.Set_Level (Name, Properties, Default);
Result.Set_Layout (Name, Properties, FULL);
Result.Prefix := Properties.Get_Value ("appender." & Name & ".prefix");
Result.Stderr := Boolean_Property.Get (Properties, "appender." & Name & ".stderr", False);
return Result.all'Access;
end Create;
end Util.Log.Appenders.Consoles;
|
with
Shell.Commands,
Ada.Text_IO;
procedure Test_Pipeline_Error
is
use Ada.Text_IO;
begin
Put_Line ("Begin 'Pipeline_Error' test.");
New_Line (2);
Put_Line ("Test 1 =>");
declare
use Shell,
Shell.Commands,
Shell.Commands.Forge;
Commands : Command_Array := To_Commands ("ls /non_existent_file | cat");
begin
Run (Commands);
if Failed (Commands)
then
declare
Which : constant Natural := Which_Failed (Commands);
Error : constant String := +Errors_Of (Results_Of (Commands (Which)));
begin
Put_Line ( "Pipeline failed as expected.");
Put_Line ( "Failed on command" & Natural'Image (Which)
& " '" & Commands (Which).Name & "'.");
Put_Line ( "Error message => '" & Error & "'");
end;
end if;
end;
New_Line (2);
Put_Line ("Test 2 =>");
declare
use Shell,
Shell.Commands,
Shell.Commands.Forge;
Commands : Command_Array := To_Commands ("ls /non_existent_file | cat");
begin
Run (Commands, Raise_Error => True);
exception
when Command_Error =>
declare
Which : constant Natural := Which_Failed (Commands);
Error : constant String := +Errors_Of (Results_Of (Commands (Which)));
begin
Put_Line ( "Pipeline failed and raised an exception, as expected.");
Put_Line ( "Failed on command" & Natural'Image (Which)
& " '" & Commands (Which).Name & "'.");
Put_Line ( "Error message => '" & Error & "'");
end;
end;
New_Line (2);
Put_Line ("End 'Pipeline_Error' test.");
end Test_Pipeline_Error;
|
-- This spec has been automatically generated from STM32F429x.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.CAN is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- master control register
type MCR_Register is record
-- INRQ
INRQ : Boolean := False;
-- SLEEP
SLEEP : Boolean := True;
-- TXFP
TXFP : Boolean := False;
-- RFLM
RFLM : Boolean := False;
-- NART
NART : Boolean := False;
-- AWUM
AWUM : Boolean := False;
-- ABOM
ABOM : Boolean := False;
-- TTCM
TTCM : Boolean := False;
-- unspecified
Reserved_8_14 : HAL.UInt7 := 16#0#;
-- RESET
RESET : Boolean := False;
-- DBF
DBF : Boolean := True;
-- unspecified
Reserved_17_31 : HAL.UInt15 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for MCR_Register use record
INRQ at 0 range 0 .. 0;
SLEEP at 0 range 1 .. 1;
TXFP at 0 range 2 .. 2;
RFLM at 0 range 3 .. 3;
NART at 0 range 4 .. 4;
AWUM at 0 range 5 .. 5;
ABOM at 0 range 6 .. 6;
TTCM at 0 range 7 .. 7;
Reserved_8_14 at 0 range 8 .. 14;
RESET at 0 range 15 .. 15;
DBF at 0 range 16 .. 16;
Reserved_17_31 at 0 range 17 .. 31;
end record;
-- master status register
type MSR_Register is record
-- Read-only. INAK
INAK : Boolean := False;
-- Read-only. SLAK
SLAK : Boolean := True;
-- ERRI
ERRI : Boolean := False;
-- WKUI
WKUI : Boolean := False;
-- SLAKI
SLAKI : Boolean := False;
-- unspecified
Reserved_5_7 : HAL.UInt3 := 16#0#;
-- Read-only. TXM
TXM : Boolean := False;
-- Read-only. RXM
RXM : Boolean := False;
-- Read-only. SAMP
SAMP : Boolean := True;
-- Read-only. RX
RX : Boolean := True;
-- unspecified
Reserved_12_31 : HAL.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for MSR_Register use record
INAK at 0 range 0 .. 0;
SLAK at 0 range 1 .. 1;
ERRI at 0 range 2 .. 2;
WKUI at 0 range 3 .. 3;
SLAKI at 0 range 4 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
TXM at 0 range 8 .. 8;
RXM at 0 range 9 .. 9;
SAMP at 0 range 10 .. 10;
RX at 0 range 11 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
subtype TSR_CODE_Field is HAL.UInt2;
-- TSR_TME array
type TSR_TME_Field_Array is array (0 .. 2) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for TSR_TME
type TSR_TME_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- TME as a value
Val : HAL.UInt3;
when True =>
-- TME as an array
Arr : TSR_TME_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for TSR_TME_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- TSR_LOW array
type TSR_LOW_Field_Array is array (0 .. 2) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for TSR_LOW
type TSR_LOW_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- LOW as a value
Val : HAL.UInt3;
when True =>
-- LOW as an array
Arr : TSR_LOW_Field_Array;
end case;
end record
with Unchecked_Union, Size => 3;
for TSR_LOW_Field use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- transmit status register
type TSR_Register is record
-- RQCP0
RQCP0 : Boolean := False;
-- TXOK0
TXOK0 : Boolean := False;
-- ALST0
ALST0 : Boolean := False;
-- TERR0
TERR0 : Boolean := False;
-- unspecified
Reserved_4_6 : HAL.UInt3 := 16#0#;
-- ABRQ0
ABRQ0 : Boolean := False;
-- RQCP1
RQCP1 : Boolean := False;
-- TXOK1
TXOK1 : Boolean := False;
-- ALST1
ALST1 : Boolean := False;
-- TERR1
TERR1 : Boolean := False;
-- unspecified
Reserved_12_14 : HAL.UInt3 := 16#0#;
-- ABRQ1
ABRQ1 : Boolean := False;
-- RQCP2
RQCP2 : Boolean := False;
-- TXOK2
TXOK2 : Boolean := False;
-- ALST2
ALST2 : Boolean := False;
-- TERR2
TERR2 : Boolean := False;
-- unspecified
Reserved_20_22 : HAL.UInt3 := 16#0#;
-- ABRQ2
ABRQ2 : Boolean := False;
-- Read-only. CODE
CODE : TSR_CODE_Field := 16#0#;
-- Read-only. Lowest priority flag for mailbox 0
TME : TSR_TME_Field := (As_Array => False, Val => 16#1#);
-- Read-only. Lowest priority flag for mailbox 0
LOW : TSR_LOW_Field := (As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TSR_Register use record
RQCP0 at 0 range 0 .. 0;
TXOK0 at 0 range 1 .. 1;
ALST0 at 0 range 2 .. 2;
TERR0 at 0 range 3 .. 3;
Reserved_4_6 at 0 range 4 .. 6;
ABRQ0 at 0 range 7 .. 7;
RQCP1 at 0 range 8 .. 8;
TXOK1 at 0 range 9 .. 9;
ALST1 at 0 range 10 .. 10;
TERR1 at 0 range 11 .. 11;
Reserved_12_14 at 0 range 12 .. 14;
ABRQ1 at 0 range 15 .. 15;
RQCP2 at 0 range 16 .. 16;
TXOK2 at 0 range 17 .. 17;
ALST2 at 0 range 18 .. 18;
TERR2 at 0 range 19 .. 19;
Reserved_20_22 at 0 range 20 .. 22;
ABRQ2 at 0 range 23 .. 23;
CODE at 0 range 24 .. 25;
TME at 0 range 26 .. 28;
LOW at 0 range 29 .. 31;
end record;
subtype RF0R_FMP0_Field is HAL.UInt2;
-- receive FIFO 0 register
type RF0R_Register is record
-- Read-only. FMP0
FMP0 : RF0R_FMP0_Field := 16#0#;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- FULL0
FULL0 : Boolean := False;
-- FOVR0
FOVR0 : Boolean := False;
-- RFOM0
RFOM0 : Boolean := False;
-- unspecified
Reserved_6_31 : HAL.UInt26 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RF0R_Register use record
FMP0 at 0 range 0 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
FULL0 at 0 range 3 .. 3;
FOVR0 at 0 range 4 .. 4;
RFOM0 at 0 range 5 .. 5;
Reserved_6_31 at 0 range 6 .. 31;
end record;
subtype RF1R_FMP1_Field is HAL.UInt2;
-- receive FIFO 1 register
type RF1R_Register is record
-- Read-only. FMP1
FMP1 : RF1R_FMP1_Field := 16#0#;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- FULL1
FULL1 : Boolean := False;
-- FOVR1
FOVR1 : Boolean := False;
-- RFOM1
RFOM1 : Boolean := False;
-- unspecified
Reserved_6_31 : HAL.UInt26 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RF1R_Register use record
FMP1 at 0 range 0 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
FULL1 at 0 range 3 .. 3;
FOVR1 at 0 range 4 .. 4;
RFOM1 at 0 range 5 .. 5;
Reserved_6_31 at 0 range 6 .. 31;
end record;
-- interrupt enable register
type IER_Register is record
-- TMEIE
TMEIE : Boolean := False;
-- FMPIE0
FMPIE0 : Boolean := False;
-- FFIE0
FFIE0 : Boolean := False;
-- FOVIE0
FOVIE0 : Boolean := False;
-- FMPIE1
FMPIE1 : Boolean := False;
-- FFIE1
FFIE1 : Boolean := False;
-- FOVIE1
FOVIE1 : Boolean := False;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
-- EWGIE
EWGIE : Boolean := False;
-- EPVIE
EPVIE : Boolean := False;
-- BOFIE
BOFIE : Boolean := False;
-- LECIE
LECIE : Boolean := False;
-- unspecified
Reserved_12_14 : HAL.UInt3 := 16#0#;
-- ERRIE
ERRIE : Boolean := False;
-- WKUIE
WKUIE : Boolean := False;
-- SLKIE
SLKIE : Boolean := False;
-- unspecified
Reserved_18_31 : HAL.UInt14 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for IER_Register use record
TMEIE at 0 range 0 .. 0;
FMPIE0 at 0 range 1 .. 1;
FFIE0 at 0 range 2 .. 2;
FOVIE0 at 0 range 3 .. 3;
FMPIE1 at 0 range 4 .. 4;
FFIE1 at 0 range 5 .. 5;
FOVIE1 at 0 range 6 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
EWGIE at 0 range 8 .. 8;
EPVIE at 0 range 9 .. 9;
BOFIE at 0 range 10 .. 10;
LECIE at 0 range 11 .. 11;
Reserved_12_14 at 0 range 12 .. 14;
ERRIE at 0 range 15 .. 15;
WKUIE at 0 range 16 .. 16;
SLKIE at 0 range 17 .. 17;
Reserved_18_31 at 0 range 18 .. 31;
end record;
subtype ESR_LEC_Field is HAL.UInt3;
subtype ESR_TEC_Field is HAL.UInt8;
subtype ESR_REC_Field is HAL.UInt8;
-- interrupt enable register
type ESR_Register is record
-- Read-only. EWGF
EWGF : Boolean := False;
-- Read-only. EPVF
EPVF : Boolean := False;
-- Read-only. BOFF
BOFF : Boolean := False;
-- unspecified
Reserved_3_3 : HAL.Bit := 16#0#;
-- LEC
LEC : ESR_LEC_Field := 16#0#;
-- unspecified
Reserved_7_15 : HAL.UInt9 := 16#0#;
-- Read-only. TEC
TEC : ESR_TEC_Field := 16#0#;
-- Read-only. REC
REC : ESR_REC_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ESR_Register use record
EWGF at 0 range 0 .. 0;
EPVF at 0 range 1 .. 1;
BOFF at 0 range 2 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
LEC at 0 range 4 .. 6;
Reserved_7_15 at 0 range 7 .. 15;
TEC at 0 range 16 .. 23;
REC at 0 range 24 .. 31;
end record;
subtype BTR_BRP_Field is HAL.UInt10;
subtype BTR_TS1_Field is HAL.UInt4;
subtype BTR_TS2_Field is HAL.UInt3;
subtype BTR_SJW_Field is HAL.UInt2;
-- bit timing register
type BTR_Register is record
-- BRP
BRP : BTR_BRP_Field := 16#0#;
-- unspecified
Reserved_10_15 : HAL.UInt6 := 16#0#;
-- TS1
TS1 : BTR_TS1_Field := 16#0#;
-- TS2
TS2 : BTR_TS2_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
-- SJW
SJW : BTR_SJW_Field := 16#0#;
-- unspecified
Reserved_26_29 : HAL.UInt4 := 16#0#;
-- LBKM
LBKM : Boolean := False;
-- SILM
SILM : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BTR_Register use record
BRP at 0 range 0 .. 9;
Reserved_10_15 at 0 range 10 .. 15;
TS1 at 0 range 16 .. 19;
TS2 at 0 range 20 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
SJW at 0 range 24 .. 25;
Reserved_26_29 at 0 range 26 .. 29;
LBKM at 0 range 30 .. 30;
SILM at 0 range 31 .. 31;
end record;
subtype TI0R_EXID_Field is HAL.UInt18;
subtype TI0R_STID_Field is HAL.UInt11;
-- TX mailbox identifier register
type TI0R_Register is record
-- TXRQ
TXRQ : Boolean := False;
-- RTR
RTR : Boolean := False;
-- IDE
IDE : Boolean := False;
-- EXID
EXID : TI0R_EXID_Field := 16#0#;
-- STID
STID : TI0R_STID_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TI0R_Register use record
TXRQ at 0 range 0 .. 0;
RTR at 0 range 1 .. 1;
IDE at 0 range 2 .. 2;
EXID at 0 range 3 .. 20;
STID at 0 range 21 .. 31;
end record;
subtype TDT0R_DLC_Field is HAL.UInt4;
subtype TDT0R_TIME_Field is HAL.UInt16;
-- mailbox data length control and time stamp register
type TDT0R_Register is record
-- DLC
DLC : TDT0R_DLC_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- TGT
TGT : Boolean := False;
-- unspecified
Reserved_9_15 : HAL.UInt7 := 16#0#;
-- TIME
TIME : TDT0R_TIME_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TDT0R_Register use record
DLC at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
TGT at 0 range 8 .. 8;
Reserved_9_15 at 0 range 9 .. 15;
TIME at 0 range 16 .. 31;
end record;
-- TDL0R_DATA array element
subtype TDL0R_DATA_Element is HAL.UInt8;
-- TDL0R_DATA array
type TDL0R_DATA_Field_Array is array (0 .. 3) of TDL0R_DATA_Element
with Component_Size => 8, Size => 32;
-- mailbox data low register
type TDL0R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : TDL0R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for TDL0R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- TDH0R_DATA array element
subtype TDH0R_DATA_Element is HAL.UInt8;
-- TDH0R_DATA array
type TDH0R_DATA_Field_Array is array (4 .. 7) of TDH0R_DATA_Element
with Component_Size => 8, Size => 32;
-- mailbox data high register
type TDH0R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : TDH0R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for TDH0R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype TI1R_EXID_Field is HAL.UInt18;
subtype TI1R_STID_Field is HAL.UInt11;
-- mailbox identifier register
type TI1R_Register is record
-- TXRQ
TXRQ : Boolean := False;
-- RTR
RTR : Boolean := False;
-- IDE
IDE : Boolean := False;
-- EXID
EXID : TI1R_EXID_Field := 16#0#;
-- STID
STID : TI1R_STID_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TI1R_Register use record
TXRQ at 0 range 0 .. 0;
RTR at 0 range 1 .. 1;
IDE at 0 range 2 .. 2;
EXID at 0 range 3 .. 20;
STID at 0 range 21 .. 31;
end record;
subtype TDT1R_DLC_Field is HAL.UInt4;
subtype TDT1R_TIME_Field is HAL.UInt16;
-- mailbox data length control and time stamp register
type TDT1R_Register is record
-- DLC
DLC : TDT1R_DLC_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- TGT
TGT : Boolean := False;
-- unspecified
Reserved_9_15 : HAL.UInt7 := 16#0#;
-- TIME
TIME : TDT1R_TIME_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TDT1R_Register use record
DLC at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
TGT at 0 range 8 .. 8;
Reserved_9_15 at 0 range 9 .. 15;
TIME at 0 range 16 .. 31;
end record;
-- TDL1R_DATA array element
subtype TDL1R_DATA_Element is HAL.UInt8;
-- TDL1R_DATA array
type TDL1R_DATA_Field_Array is array (0 .. 3) of TDL1R_DATA_Element
with Component_Size => 8, Size => 32;
-- mailbox data low register
type TDL1R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : TDL1R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for TDL1R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- TDH1R_DATA array element
subtype TDH1R_DATA_Element is HAL.UInt8;
-- TDH1R_DATA array
type TDH1R_DATA_Field_Array is array (4 .. 7) of TDH1R_DATA_Element
with Component_Size => 8, Size => 32;
-- mailbox data high register
type TDH1R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : TDH1R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for TDH1R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype TI2R_EXID_Field is HAL.UInt18;
subtype TI2R_STID_Field is HAL.UInt11;
-- mailbox identifier register
type TI2R_Register is record
-- TXRQ
TXRQ : Boolean := False;
-- RTR
RTR : Boolean := False;
-- IDE
IDE : Boolean := False;
-- EXID
EXID : TI2R_EXID_Field := 16#0#;
-- STID
STID : TI2R_STID_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TI2R_Register use record
TXRQ at 0 range 0 .. 0;
RTR at 0 range 1 .. 1;
IDE at 0 range 2 .. 2;
EXID at 0 range 3 .. 20;
STID at 0 range 21 .. 31;
end record;
subtype TDT2R_DLC_Field is HAL.UInt4;
subtype TDT2R_TIME_Field is HAL.UInt16;
-- mailbox data length control and time stamp register
type TDT2R_Register is record
-- DLC
DLC : TDT2R_DLC_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- TGT
TGT : Boolean := False;
-- unspecified
Reserved_9_15 : HAL.UInt7 := 16#0#;
-- TIME
TIME : TDT2R_TIME_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TDT2R_Register use record
DLC at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
TGT at 0 range 8 .. 8;
Reserved_9_15 at 0 range 9 .. 15;
TIME at 0 range 16 .. 31;
end record;
-- TDL2R_DATA array element
subtype TDL2R_DATA_Element is HAL.UInt8;
-- TDL2R_DATA array
type TDL2R_DATA_Field_Array is array (0 .. 3) of TDL2R_DATA_Element
with Component_Size => 8, Size => 32;
-- mailbox data low register
type TDL2R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : TDL2R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for TDL2R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- TDH2R_DATA array element
subtype TDH2R_DATA_Element is HAL.UInt8;
-- TDH2R_DATA array
type TDH2R_DATA_Field_Array is array (4 .. 7) of TDH2R_DATA_Element
with Component_Size => 8, Size => 32;
-- mailbox data high register
type TDH2R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : TDH2R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for TDH2R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype RI0R_EXID_Field is HAL.UInt18;
subtype RI0R_STID_Field is HAL.UInt11;
-- receive FIFO mailbox identifier register
type RI0R_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit;
-- Read-only. RTR
RTR : Boolean;
-- Read-only. IDE
IDE : Boolean;
-- Read-only. EXID
EXID : RI0R_EXID_Field;
-- Read-only. STID
STID : RI0R_STID_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RI0R_Register use record
Reserved_0_0 at 0 range 0 .. 0;
RTR at 0 range 1 .. 1;
IDE at 0 range 2 .. 2;
EXID at 0 range 3 .. 20;
STID at 0 range 21 .. 31;
end record;
subtype RDT0R_DLC_Field is HAL.UInt4;
subtype RDT0R_FMI_Field is HAL.UInt8;
subtype RDT0R_TIME_Field is HAL.UInt16;
-- mailbox data high register
type RDT0R_Register is record
-- Read-only. DLC
DLC : RDT0R_DLC_Field;
-- unspecified
Reserved_4_7 : HAL.UInt4;
-- Read-only. FMI
FMI : RDT0R_FMI_Field;
-- Read-only. TIME
TIME : RDT0R_TIME_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RDT0R_Register use record
DLC at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
FMI at 0 range 8 .. 15;
TIME at 0 range 16 .. 31;
end record;
-- RDL0R_DATA array element
subtype RDL0R_DATA_Element is HAL.UInt8;
-- RDL0R_DATA array
type RDL0R_DATA_Field_Array is array (0 .. 3) of RDL0R_DATA_Element
with Component_Size => 8, Size => 32;
-- mailbox data high register
type RDL0R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : RDL0R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for RDL0R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- RDH0R_DATA array element
subtype RDH0R_DATA_Element is HAL.UInt8;
-- RDH0R_DATA array
type RDH0R_DATA_Field_Array is array (4 .. 7) of RDH0R_DATA_Element
with Component_Size => 8, Size => 32;
-- receive FIFO mailbox data high register
type RDH0R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : RDH0R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for RDH0R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype RI1R_EXID_Field is HAL.UInt18;
subtype RI1R_STID_Field is HAL.UInt11;
-- mailbox data high register
type RI1R_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit;
-- Read-only. RTR
RTR : Boolean;
-- Read-only. IDE
IDE : Boolean;
-- Read-only. EXID
EXID : RI1R_EXID_Field;
-- Read-only. STID
STID : RI1R_STID_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RI1R_Register use record
Reserved_0_0 at 0 range 0 .. 0;
RTR at 0 range 1 .. 1;
IDE at 0 range 2 .. 2;
EXID at 0 range 3 .. 20;
STID at 0 range 21 .. 31;
end record;
subtype RDT1R_DLC_Field is HAL.UInt4;
subtype RDT1R_FMI_Field is HAL.UInt8;
subtype RDT1R_TIME_Field is HAL.UInt16;
-- mailbox data high register
type RDT1R_Register is record
-- Read-only. DLC
DLC : RDT1R_DLC_Field;
-- unspecified
Reserved_4_7 : HAL.UInt4;
-- Read-only. FMI
FMI : RDT1R_FMI_Field;
-- Read-only. TIME
TIME : RDT1R_TIME_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for RDT1R_Register use record
DLC at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
FMI at 0 range 8 .. 15;
TIME at 0 range 16 .. 31;
end record;
-- RDL1R_DATA array element
subtype RDL1R_DATA_Element is HAL.UInt8;
-- RDL1R_DATA array
type RDL1R_DATA_Field_Array is array (0 .. 3) of RDL1R_DATA_Element
with Component_Size => 8, Size => 32;
-- mailbox data high register
type RDL1R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : RDL1R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for RDL1R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- RDH1R_DATA array element
subtype RDH1R_DATA_Element is HAL.UInt8;
-- RDH1R_DATA array
type RDH1R_DATA_Field_Array is array (4 .. 7) of RDH1R_DATA_Element
with Component_Size => 8, Size => 32;
-- mailbox data high register
type RDH1R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- DATA as a value
Val : HAL.UInt32;
when True =>
-- DATA as an array
Arr : RDH1R_DATA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for RDH1R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype FMR_CAN2SB_Field is HAL.UInt6;
-- filter master register
type FMR_Register is record
-- FINIT
FINIT : Boolean := True;
-- unspecified
Reserved_1_7 : HAL.UInt7 := 16#0#;
-- CAN2SB
CAN2SB : FMR_CAN2SB_Field := 16#E#;
-- unspecified
Reserved_14_31 : HAL.UInt18 := 16#A870#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FMR_Register use record
FINIT at 0 range 0 .. 0;
Reserved_1_7 at 0 range 1 .. 7;
CAN2SB at 0 range 8 .. 13;
Reserved_14_31 at 0 range 14 .. 31;
end record;
-- FM1R_FBM array
type FM1R_FBM_Field_Array is array (0 .. 27) of Boolean
with Component_Size => 1, Size => 28;
-- Type definition for FM1R_FBM
type FM1R_FBM_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FBM as a value
Val : HAL.UInt28;
when True =>
-- FBM as an array
Arr : FM1R_FBM_Field_Array;
end case;
end record
with Unchecked_Union, Size => 28;
for FM1R_FBM_Field use record
Val at 0 range 0 .. 27;
Arr at 0 range 0 .. 27;
end record;
-- filter mode register
type FM1R_Register is record
-- Filter mode
FBM : FM1R_FBM_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FM1R_Register use record
FBM at 0 range 0 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
-- FS1R_FSC array
type FS1R_FSC_Field_Array is array (0 .. 27) of Boolean
with Component_Size => 1, Size => 28;
-- Type definition for FS1R_FSC
type FS1R_FSC_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FSC as a value
Val : HAL.UInt28;
when True =>
-- FSC as an array
Arr : FS1R_FSC_Field_Array;
end case;
end record
with Unchecked_Union, Size => 28;
for FS1R_FSC_Field use record
Val at 0 range 0 .. 27;
Arr at 0 range 0 .. 27;
end record;
-- filter scale register
type FS1R_Register is record
-- Filter scale configuration
FSC : FS1R_FSC_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS1R_Register use record
FSC at 0 range 0 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
-- FFA1R_FFA array
type FFA1R_FFA_Field_Array is array (0 .. 27) of Boolean
with Component_Size => 1, Size => 28;
-- Type definition for FFA1R_FFA
type FFA1R_FFA_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FFA as a value
Val : HAL.UInt28;
when True =>
-- FFA as an array
Arr : FFA1R_FFA_Field_Array;
end case;
end record
with Unchecked_Union, Size => 28;
for FFA1R_FFA_Field use record
Val at 0 range 0 .. 27;
Arr at 0 range 0 .. 27;
end record;
-- filter FIFO assignment register
type FFA1R_Register is record
-- Filter FIFO assignment for filter 0
FFA : FFA1R_FFA_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FFA1R_Register use record
FFA at 0 range 0 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
-- FA1R_FACT array
type FA1R_FACT_Field_Array is array (0 .. 27) of Boolean
with Component_Size => 1, Size => 28;
-- Type definition for FA1R_FACT
type FA1R_FACT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FACT as a value
Val : HAL.UInt28;
when True =>
-- FACT as an array
Arr : FA1R_FACT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 28;
for FA1R_FACT_Field use record
Val at 0 range 0 .. 27;
Arr at 0 range 0 .. 27;
end record;
-- filter activation register
type FA1R_Register is record
-- Filter active
FACT : FA1R_FACT_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FA1R_Register use record
FACT at 0 range 0 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
-- F0R_FB array
type F0R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 0 register 1
type F0R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F0R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F0R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F1R_FB array
type F1R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 1 register 1
type F1R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F1R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F1R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F2R_FB array
type F2R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 2 register 1
type F2R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F2R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F2R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F3R_FB array
type F3R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 3 register 1
type F3R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F3R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F3R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F4R_FB array
type F4R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 4 register 1
type F4R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F4R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F4R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F5R_FB array
type F5R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 5 register 1
type F5R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F5R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F5R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F6R_FB array
type F6R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 6 register 1
type F6R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F6R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F6R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F7R_FB array
type F7R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 7 register 1
type F7R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F7R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F7R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F8R_FB array
type F8R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 8 register 1
type F8R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F8R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F8R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F9R_FB array
type F9R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 9 register 1
type F9R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F9R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F9R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F10R_FB array
type F10R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 10 register 1
type F10R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F10R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F10R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F11R_FB array
type F11R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 11 register 1
type F11R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F11R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F11R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F12R_FB array
type F12R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 4 register 1
type F12R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F12R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F12R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F13R_FB array
type F13R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 13 register 1
type F13R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F13R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F13R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F14R_FB array
type F14R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 14 register 1
type F14R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F14R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F14R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F15R_FB array
type F15R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 15 register 1
type F15R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F15R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F15R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F16R_FB array
type F16R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 16 register 1
type F16R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F16R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F16R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F17R_FB array
type F17R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 17 register 1
type F17R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F17R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F17R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F18R_FB array
type F18R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 18 register 1
type F18R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F18R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F18R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F19R_FB array
type F19R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 19 register 1
type F19R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F19R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F19R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F20R_FB array
type F20R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 20 register 1
type F20R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F20R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F20R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F21R_FB array
type F21R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 21 register 1
type F21R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F21R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F21R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F22R_FB array
type F22R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 22 register 1
type F22R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F22R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F22R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F23R_FB array
type F23R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 23 register 1
type F23R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F23R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F23R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F24R_FB array
type F24R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 24 register 1
type F24R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F24R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F24R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F25R_FB array
type F25R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 25 register 1
type F25R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F25R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F25R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F26R_FB array
type F26R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 26 register 1
type F26R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F26R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F26R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- F27R_FB array
type F27R_FB_Field_Array is array (0 .. 31) of Boolean
with Component_Size => 1, Size => 32;
-- Filter bank 27 register 1
type F27R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- FB as a value
Val : HAL.UInt32;
when True =>
-- FB as an array
Arr : F27R_FB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for F27R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Controller area network
type CAN_Peripheral is record
-- master control register
MCR : aliased MCR_Register;
-- master status register
MSR : aliased MSR_Register;
-- transmit status register
TSR : aliased TSR_Register;
-- receive FIFO 0 register
RF0R : aliased RF0R_Register;
-- receive FIFO 1 register
RF1R : aliased RF1R_Register;
-- interrupt enable register
IER : aliased IER_Register;
-- interrupt enable register
ESR : aliased ESR_Register;
-- bit timing register
BTR : aliased BTR_Register;
-- TX mailbox identifier register
TI0R : aliased TI0R_Register;
-- mailbox data length control and time stamp register
TDT0R : aliased TDT0R_Register;
-- mailbox data low register
TDL0R : aliased TDL0R_Register;
-- mailbox data high register
TDH0R : aliased TDH0R_Register;
-- mailbox identifier register
TI1R : aliased TI1R_Register;
-- mailbox data length control and time stamp register
TDT1R : aliased TDT1R_Register;
-- mailbox data low register
TDL1R : aliased TDL1R_Register;
-- mailbox data high register
TDH1R : aliased TDH1R_Register;
-- mailbox identifier register
TI2R : aliased TI2R_Register;
-- mailbox data length control and time stamp register
TDT2R : aliased TDT2R_Register;
-- mailbox data low register
TDL2R : aliased TDL2R_Register;
-- mailbox data high register
TDH2R : aliased TDH2R_Register;
-- receive FIFO mailbox identifier register
RI0R : aliased RI0R_Register;
-- mailbox data high register
RDT0R : aliased RDT0R_Register;
-- mailbox data high register
RDL0R : aliased RDL0R_Register;
-- receive FIFO mailbox data high register
RDH0R : aliased RDH0R_Register;
-- mailbox data high register
RI1R : aliased RI1R_Register;
-- mailbox data high register
RDT1R : aliased RDT1R_Register;
-- mailbox data high register
RDL1R : aliased RDL1R_Register;
-- mailbox data high register
RDH1R : aliased RDH1R_Register;
-- filter master register
FMR : aliased FMR_Register;
-- filter mode register
FM1R : aliased FM1R_Register;
-- filter scale register
FS1R : aliased FS1R_Register;
-- filter FIFO assignment register
FFA1R : aliased FFA1R_Register;
-- filter activation register
FA1R : aliased FA1R_Register;
-- Filter bank 0 register 1
F0R1 : aliased F0R_Register;
-- Filter bank 0 register 2
F0R2 : aliased F0R_Register;
-- Filter bank 1 register 1
F1R1 : aliased F1R_Register;
-- Filter bank 1 register 2
F1R2 : aliased F1R_Register;
-- Filter bank 2 register 1
F2R1 : aliased F2R_Register;
-- Filter bank 2 register 2
F2R2 : aliased F2R_Register;
-- Filter bank 3 register 1
F3R1 : aliased F3R_Register;
-- Filter bank 3 register 2
F3R2 : aliased F3R_Register;
-- Filter bank 4 register 1
F4R1 : aliased F4R_Register;
-- Filter bank 4 register 2
F4R2 : aliased F4R_Register;
-- Filter bank 5 register 1
F5R1 : aliased F5R_Register;
-- Filter bank 5 register 2
F5R2 : aliased F5R_Register;
-- Filter bank 6 register 1
F6R1 : aliased F6R_Register;
-- Filter bank 6 register 2
F6R2 : aliased F6R_Register;
-- Filter bank 7 register 1
F7R1 : aliased F7R_Register;
-- Filter bank 7 register 2
F7R2 : aliased F7R_Register;
-- Filter bank 8 register 1
F8R1 : aliased F8R_Register;
-- Filter bank 8 register 2
F8R2 : aliased F8R_Register;
-- Filter bank 9 register 1
F9R1 : aliased F9R_Register;
-- Filter bank 9 register 2
F9R2 : aliased F9R_Register;
-- Filter bank 10 register 1
F10R1 : aliased F10R_Register;
-- Filter bank 10 register 2
F10R2 : aliased F10R_Register;
-- Filter bank 11 register 1
F11R1 : aliased F11R_Register;
-- Filter bank 11 register 2
F11R2 : aliased F11R_Register;
-- Filter bank 4 register 1
F12R1 : aliased F12R_Register;
-- Filter bank 12 register 2
F12R2 : aliased F12R_Register;
-- Filter bank 13 register 1
F13R1 : aliased F13R_Register;
-- Filter bank 13 register 2
F13R2 : aliased F13R_Register;
-- Filter bank 14 register 1
F14R1 : aliased F14R_Register;
-- Filter bank 14 register 2
F14R2 : aliased F14R_Register;
-- Filter bank 15 register 1
F15R1 : aliased F15R_Register;
-- Filter bank 15 register 2
F15R2 : aliased F15R_Register;
-- Filter bank 16 register 1
F16R1 : aliased F16R_Register;
-- Filter bank 16 register 2
F16R2 : aliased F16R_Register;
-- Filter bank 17 register 1
F17R1 : aliased F17R_Register;
-- Filter bank 17 register 2
F17R2 : aliased F17R_Register;
-- Filter bank 18 register 1
F18R1 : aliased F18R_Register;
-- Filter bank 18 register 2
F18R2 : aliased F18R_Register;
-- Filter bank 19 register 1
F19R1 : aliased F19R_Register;
-- Filter bank 19 register 2
F19R2 : aliased F19R_Register;
-- Filter bank 20 register 1
F20R1 : aliased F20R_Register;
-- Filter bank 20 register 2
F20R2 : aliased F20R_Register;
-- Filter bank 21 register 1
F21R1 : aliased F21R_Register;
-- Filter bank 21 register 2
F21R2 : aliased F21R_Register;
-- Filter bank 22 register 1
F22R1 : aliased F22R_Register;
-- Filter bank 22 register 2
F22R2 : aliased F22R_Register;
-- Filter bank 23 register 1
F23R1 : aliased F23R_Register;
-- Filter bank 23 register 2
F23R2 : aliased F23R_Register;
-- Filter bank 24 register 1
F24R1 : aliased F24R_Register;
-- Filter bank 24 register 2
F24R2 : aliased F24R_Register;
-- Filter bank 25 register 1
F25R1 : aliased F25R_Register;
-- Filter bank 25 register 2
F25R2 : aliased F25R_Register;
-- Filter bank 26 register 1
F26R1 : aliased F26R_Register;
-- Filter bank 26 register 2
F26R2 : aliased F26R_Register;
-- Filter bank 27 register 1
F27R1 : aliased F27R_Register;
-- Filter bank 27 register 2
F27R2 : aliased F27R_Register;
end record
with Volatile;
for CAN_Peripheral use record
MCR at 16#0# range 0 .. 31;
MSR at 16#4# range 0 .. 31;
TSR at 16#8# range 0 .. 31;
RF0R at 16#C# range 0 .. 31;
RF1R at 16#10# range 0 .. 31;
IER at 16#14# range 0 .. 31;
ESR at 16#18# range 0 .. 31;
BTR at 16#1C# range 0 .. 31;
TI0R at 16#180# range 0 .. 31;
TDT0R at 16#184# range 0 .. 31;
TDL0R at 16#188# range 0 .. 31;
TDH0R at 16#18C# range 0 .. 31;
TI1R at 16#190# range 0 .. 31;
TDT1R at 16#194# range 0 .. 31;
TDL1R at 16#198# range 0 .. 31;
TDH1R at 16#19C# range 0 .. 31;
TI2R at 16#1A0# range 0 .. 31;
TDT2R at 16#1A4# range 0 .. 31;
TDL2R at 16#1A8# range 0 .. 31;
TDH2R at 16#1AC# range 0 .. 31;
RI0R at 16#1B0# range 0 .. 31;
RDT0R at 16#1B4# range 0 .. 31;
RDL0R at 16#1B8# range 0 .. 31;
RDH0R at 16#1BC# range 0 .. 31;
RI1R at 16#1C0# range 0 .. 31;
RDT1R at 16#1C4# range 0 .. 31;
RDL1R at 16#1C8# range 0 .. 31;
RDH1R at 16#1CC# range 0 .. 31;
FMR at 16#200# range 0 .. 31;
FM1R at 16#204# range 0 .. 31;
FS1R at 16#20C# range 0 .. 31;
FFA1R at 16#214# range 0 .. 31;
FA1R at 16#21C# range 0 .. 31;
F0R1 at 16#240# range 0 .. 31;
F0R2 at 16#244# range 0 .. 31;
F1R1 at 16#248# range 0 .. 31;
F1R2 at 16#24C# range 0 .. 31;
F2R1 at 16#250# range 0 .. 31;
F2R2 at 16#254# range 0 .. 31;
F3R1 at 16#258# range 0 .. 31;
F3R2 at 16#25C# range 0 .. 31;
F4R1 at 16#260# range 0 .. 31;
F4R2 at 16#264# range 0 .. 31;
F5R1 at 16#268# range 0 .. 31;
F5R2 at 16#26C# range 0 .. 31;
F6R1 at 16#270# range 0 .. 31;
F6R2 at 16#274# range 0 .. 31;
F7R1 at 16#278# range 0 .. 31;
F7R2 at 16#27C# range 0 .. 31;
F8R1 at 16#280# range 0 .. 31;
F8R2 at 16#284# range 0 .. 31;
F9R1 at 16#288# range 0 .. 31;
F9R2 at 16#28C# range 0 .. 31;
F10R1 at 16#290# range 0 .. 31;
F10R2 at 16#294# range 0 .. 31;
F11R1 at 16#298# range 0 .. 31;
F11R2 at 16#29C# range 0 .. 31;
F12R1 at 16#2A0# range 0 .. 31;
F12R2 at 16#2A4# range 0 .. 31;
F13R1 at 16#2A8# range 0 .. 31;
F13R2 at 16#2AC# range 0 .. 31;
F14R1 at 16#2B0# range 0 .. 31;
F14R2 at 16#2B4# range 0 .. 31;
F15R1 at 16#2B8# range 0 .. 31;
F15R2 at 16#2BC# range 0 .. 31;
F16R1 at 16#2C0# range 0 .. 31;
F16R2 at 16#2C4# range 0 .. 31;
F17R1 at 16#2C8# range 0 .. 31;
F17R2 at 16#2CC# range 0 .. 31;
F18R1 at 16#2D0# range 0 .. 31;
F18R2 at 16#2D4# range 0 .. 31;
F19R1 at 16#2D8# range 0 .. 31;
F19R2 at 16#2DC# range 0 .. 31;
F20R1 at 16#2E0# range 0 .. 31;
F20R2 at 16#2E4# range 0 .. 31;
F21R1 at 16#2E8# range 0 .. 31;
F21R2 at 16#2EC# range 0 .. 31;
F22R1 at 16#2F0# range 0 .. 31;
F22R2 at 16#2F4# range 0 .. 31;
F23R1 at 16#2F8# range 0 .. 31;
F23R2 at 16#2FC# range 0 .. 31;
F24R1 at 16#300# range 0 .. 31;
F24R2 at 16#304# range 0 .. 31;
F25R1 at 16#308# range 0 .. 31;
F25R2 at 16#30C# range 0 .. 31;
F26R1 at 16#310# range 0 .. 31;
F26R2 at 16#314# range 0 .. 31;
F27R1 at 16#318# range 0 .. 31;
F27R2 at 16#31C# range 0 .. 31;
end record;
-- Controller area network
CAN1_Periph : aliased CAN_Peripheral
with Import, Address => System'To_Address (16#40006400#);
-- Controller area network
CAN2_Periph : aliased CAN_Peripheral
with Import, Address => System'To_Address (16#40006800#);
end STM32_SVD.CAN;
|
with GNAT.Command_Line; use GNAT.Command_Line;
with Ada; use Ada;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Streams.Stream_IO;
use Ada.Streams;
with BMP; use BMP;
with Interfaces; use Interfaces;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Directories;
with GNAT.OS_Lib;
procedure Main is
File_In : Stream_IO.File_Type;
File_Out : Ada.Text_IO.File_Type;
Input : Stream_IO.Stream_Access;
Header : BMP.Header;
Info : BMP.Info;
Row_Size, Row_Padding : Integer;
Output_Dir : Unbounded_String := Null_Unbounded_String;
Output_Filename : Unbounded_String := Null_Unbounded_String;
function Get_Obj_Dir (Filename : String) return Boolean;
procedure Print_Help;
-----------------
-- Get_Obj_Dir --
-----------------
function Get_Obj_Dir (Filename : String) return Boolean is
File : Ada.Text_IO.File_Type;
begin
Ada.Text_IO.Open (File => File,
Mode => Ada.Text_IO.In_File,
Name => Filename);
declare
Line : constant String := Ada.Text_IO.Get_Line (File);
begin
Ada.Text_IO.Close (File);
if Line'Length /= 0 then
Text_IO.Put_Line ("Output directory: '" & Line & "'");
Output_Dir := To_Unbounded_String (Line);
return True;
else
return False;
end if;
end;
end Get_Obj_Dir;
----------------
-- Print_Help --
----------------
procedure Print_Help is
begin
Put_Line ("bmp2ada -o <output_filename> <input_bitmap_file>");
Put_Line (" --dma2d to enable STM32 DMAD2 format");
end Print_Help;
begin
loop
case Getopt ("o: d: v h -help -dma2d") is
when 'o' =>
Output_Filename := To_Unbounded_String (Parameter);
Put_Line ("Output filename:" & Parameter);
when 'd' =>
if not Get_Obj_Dir (Parameter) then
return;
end if;
when 'v' =>
BMP.Verbose := True;
when 'h' =>
Print_Help;
return;
when '-' =>
if Full_Switch = "-help" then
Print_Help;
return;
elsif Full_Switch = "-dma2d" then
DMA2D_Format := True;
end if;
when others =>
exit;
end case;
end loop;
declare
Input_Filename : constant String := Get_Argument (Do_Expansion => True);
Output_Path : constant String :=
To_String (Output_Dir & Output_Filename);
Package_Name : constant String :=
Ada.Directories.Base_Name (Input_Filename);
begin
if Input_Filename'Length = 0 then
Put_Line ("Input filename missing...");
GNAT.OS_Lib.OS_Exit (-1);
end if;
Put_Line ("Openning input " & Input_Filename);
Stream_IO.Open (File_In, Stream_IO.In_File, Input_Filename);
Input := Stream_IO.Stream (File_In);
Put_Line ("Creating output " & Output_Path);
Text_IO.Create (File_Out, Text_IO.Out_File, Output_Path);
Put_Line ("Creating package: " & Package_Name);
BMP.Header'Read (Input, Header);
Text_IO.Put_Line ("Signature " & Header.Signature'Img);
Text_IO.Put_Line ("Size " & Header.Size'Img);
Text_IO.Put_Line ("Reserved1 " & Header.Reserved1'Img);
Text_IO.Put_Line ("Reserved2 " & Header.Reserved2'Img);
Text_IO.Put_Line ("Offset " & Header.Offset'Img);
BMP.Info'Read (Input, Info);
Text_IO.Put_Line ("Struct_Size " & Info.Struct_Size'Img);
Text_IO.Put_Line ("Width " & Info.Width'Img);
Text_IO.Put_Line ("Height " & Info.Height'Img);
Text_IO.Put_Line ("Planes " & Info.Planes'Img);
Text_IO.Put_Line ("Pixel_Size " & Info.Pixel_Size'Img);
Text_IO.Put_Line ("Compression " & Info.Compression'Img);
Text_IO.Put_Line ("Image_Size " & Info.Image_Size'Img);
Text_IO.Put_Line ("PPMX " & Info.PPMX'Img);
Text_IO.Put_Line ("PPMY " & Info.PPMY'Img);
Text_IO.Put_Line ("Palette_Size " & Info.Palette_Size'Img);
Text_IO.Put_Line ("Important " & Info.Important'Img);
Row_Size := Integer (Info.Width) * Integer (Info.Pixel_Size);
Row_Padding := (32 - (Row_Size mod 32)) mod 32;
Row_Size := (Row_Size + Row_Padding) / 8;
Row_Padding := Row_Padding / 8;
Text_IO.Put_Line ("Row_Size " & Row_Size'Img);
Text_IO.Put_Line ("Row_Padding " & Row_Padding'Img);
if Info.Compression /= 0 then
Put_Line ("Compression not supported.");
GNAT.OS_Lib.OS_Exit (-1);
end if;
if DMA2D_Format then
case Info.Pixel_Size is
when 1 | 2 | 4 | 8 | 24 =>
null;
when others =>
Put_Line ("Only 2, 16 and 256 palette size support supported" &
"for DMA2D output.");
GNAT.OS_Lib.OS_Exit (-1);
end case;
end if;
if Info.Palette_Size /= 0 then
BMP.Palettized (File_In,
Input,
File_Out,
Package_Name,
Header,
Info,
Row_Size);
else
BMP.Standard (File_In,
Input,
File_Out,
Package_Name,
Header,
Info,
Row_Size);
end if;
Ada.Text_IO.Close (File_Out);
Stream_IO.Close (File_In);
end;
end Main;
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="17">
<syndb class_id="0" tracking_level="0" version="0">
<userIPLatency>-1</userIPLatency>
<userIPName/>
<cdfg class_id="1" tracking_level="1" version="0" object_id="_0">
<name>packet_identification</name>
<module_structure>Pipeline</module_structure>
<ret_bitwidth>0</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>6</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>s_axis_V_data_V</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo class_id="6" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>3621216858</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs class_id="7" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_2">
<Value>
<Obj>
<type>1</type>
<id>2</id>
<name>s_axis_V_keep_V</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>64</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>s_axis_V_strb_V</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>107</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>64</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>s_axis_V_last_V</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>107</coreId>
<rtlModuleName/>
</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="_5">
<Value>
<Obj>
<type>1</type>
<id>5</id>
<name>s_axis_V_dest_V</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>107</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>3</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="_6">
<Value>
<Obj>
<type>1</type>
<id>8</id>
<name>eth_level_pkt</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName>FIFO</coreName>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>1024</bitwidth>
</Value>
<direction>1</direction>
<if_type>3</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
</ports>
<nodes class_id="8" tracking_level="0" version="0">
<count>59</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_7">
<Value>
<Obj>
<type>0</type>
<id>15</id>
<name>pi_fsm_state_load</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>188</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="10" tracking_level="0" version="0">
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</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>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>188</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>1667592275</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>2</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>96</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>0.00</m_delay>
<m_topoIndex>1</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_8">
<Value>
<Obj>
<type>0</type>
<id>16</id>
<name>_ln188</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>188</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>188</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>3868812800</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>8</count>
<item_version>0</item_version>
<item>97</item>
<item>98</item>
<item>100</item>
<item>101</item>
<item>103</item>
<item>104</item>
<item>106</item>
<item>107</item>
</oprand_edges>
<opcode>switch</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.65</m_delay>
<m_topoIndex>2</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_9">
<Value>
<Obj>
<type>0</type>
<id>18</id>
<name>tmp_2</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>267</lineNumber>
<contextFuncName>empty</contextFuncName>
<contextNormFuncName>empty</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</first>
<second>empty</second>
</first>
<second>267</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>tmp</originalName>
<rtlName/>
<control>auto</control>
<opType>adapter</opType>
<implIndex>axi4stream</implIndex>
<coreName>axis</coreName>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>123</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>7</count>
<item_version>0</item_version>
<item>272</item>
<item>273</item>
<item>274</item>
<item>275</item>
<item>276</item>
<item>277</item>
<item>278</item>
</oprand_edges>
<opcode>nbreadreq</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="_10">
<Value>
<Obj>
<type>0</type>
<id>19</id>
<name>br_ln256</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>256</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>256</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>1814062958</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>279</item>
<item>280</item>
<item>281</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>4</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_11">
<Value>
<Obj>
<type>0</type>
<id>21</id>
<name>empty_15</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>283</lineNumber>
<contextFuncName>read</contextFuncName>
<contextNormFuncName>read</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</first>
<second>read</second>
</first>
<second>283</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control>auto</control>
<opType>adapter</opType>
<implIndex>axi4stream</implIndex>
<coreName>axis</coreName>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>123</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>644</bitwidth>
</Value>
<oprand_edges>
<count>7</count>
<item_version>0</item_version>
<item>282</item>
<item>283</item>
<item>284</item>
<item>285</item>
<item>286</item>
<item>287</item>
<item>436</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>5</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_12">
<Value>
<Obj>
<type>0</type>
<id>22</id>
<name>tmp_12</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>283</lineNumber>
<contextFuncName>read</contextFuncName>
<contextNormFuncName>read</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</first>
<second>read</second>
</first>
<second>283</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>tmp</originalName>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>3861265056</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>288</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>6</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_13">
<Value>
<Obj>
<type>0</type>
<id>23</id>
<name>br_ln258</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>258</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>258</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>55922960</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>289</item>
<item>290</item>
<item>291</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>7</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_14">
<Value>
<Obj>
<type>0</type>
<id>25</id>
<name>pi_fsm_state_write_ln259</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>259</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>259</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>292</item>
<item>293</item>
<item>434</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>0.38</m_delay>
<m_topoIndex>8</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_15">
<Value>
<Obj>
<type>0</type>
<id>26</id>
<name>br_ln260</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>260</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>260</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>1</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>294</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>9</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_16">
<Value>
<Obj>
<type>0</type>
<id>28</id>
<name>br_ln261</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>261</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>261</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>295</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>10</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_17">
<Value>
<Obj>
<type>0</type>
<id>30</id>
<name>tmp_1</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>267</lineNumber>
<contextFuncName>empty</contextFuncName>
<contextNormFuncName>empty</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</first>
<second>empty</second>
</first>
<second>267</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>tmp</originalName>
<rtlName/>
<control>auto</control>
<opType>adapter</opType>
<implIndex>axi4stream</implIndex>
<coreName>axis</coreName>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>123</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>7</count>
<item_version>0</item_version>
<item>234</item>
<item>235</item>
<item>236</item>
<item>237</item>
<item>238</item>
<item>239</item>
<item>240</item>
</oprand_edges>
<opcode>nbreadreq</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="_18">
<Value>
<Obj>
<type>0</type>
<id>31</id>
<name>br_ln241</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>241</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>241</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>241</item>
<item>242</item>
<item>243</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>12</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_19">
<Value>
<Obj>
<type>0</type>
<id>33</id>
<name>empty_14</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>283</lineNumber>
<contextFuncName>read</contextFuncName>
<contextNormFuncName>read</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</first>
<second>read</second>
</first>
<second>283</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control>auto</control>
<opType>adapter</opType>
<implIndex>axi4stream</implIndex>
<coreName>axis</coreName>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>123</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>644</bitwidth>
</Value>
<oprand_edges>
<count>7</count>
<item_version>0</item_version>
<item>244</item>
<item>245</item>
<item>246</item>
<item>247</item>
<item>248</item>
<item>249</item>
<item>437</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>13</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_20">
<Value>
<Obj>
<type>0</type>
<id>34</id>
<name>tmp_7</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>283</lineNumber>
<contextFuncName>read</contextFuncName>
<contextNormFuncName>read</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</first>
<second>read</second>
</first>
<second>283</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>tmp</originalName>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56341808</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>250</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>14</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_21">
<Value>
<Obj>
<type>0</type>
<id>35</id>
<name>tmp_8</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>283</lineNumber>
<contextFuncName>read</contextFuncName>
<contextNormFuncName>read</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</first>
<second>read</second>
</first>
<second>283</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>tmp</originalName>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>480</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>251</item>
</oprand_edges>
<opcode>extractvalue</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="_22">
<Value>
<Obj>
<type>0</type>
<id>36</id>
<name>tmp_11</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>283</lineNumber>
<contextFuncName>read</contextFuncName>
<contextNormFuncName>read</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</first>
<second>read</second>
</first>
<second>283</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>tmp</originalName>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>1953394531</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>252</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>16</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_23">
<Value>
<Obj>
<type>0</type>
<id>37</id>
<name>sendWord_dest_V</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>247</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>247</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>sendWord.dest.V</originalName>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>2</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>253</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>0.00</m_delay>
<m_topoIndex>48</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_24">
<Value>
<Obj>
<type>0</type>
<id>38</id>
<name>tmp_s</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/hls_stream_39.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>174</lineNumber>
<contextFuncName>write</contextFuncName>
<contextNormFuncName>write</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/hls_stream_39.h</first>
<second>write</second>
</first>
<second>174</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_s_fu_287_p6</rtlName>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>586</bitwidth>
</Value>
<oprand_edges>
<count>6</count>
<item_version>0</item_version>
<item>254</item>
<item>255</item>
<item>256</item>
<item>257</item>
<item>258</item>
<item>259</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>49</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_25">
<Value>
<Obj>
<type>0</type>
<id>39</id>
<name>zext_ln174</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/hls_stream_39.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>174</lineNumber>
<contextFuncName>write</contextFuncName>
<contextNormFuncName>write</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/hls_stream_39.h</first>
<second>write</second>
</first>
<second>174</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>zext_ln174_fu_300_p1</rtlName>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56248624</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>1024</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>260</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>50</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_26">
<Value>
<Obj>
<type>0</type>
<id>40</id>
<name>eth_level_pkt_write_ln174</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/hls_stream_39.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>174</lineNumber>
<contextFuncName>write</contextFuncName>
<contextNormFuncName>write</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/hls_stream_39.h</first>
<second>write</second>
</first>
<second>174</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control>auto</control>
<opType>fifo</opType>
<implIndex>memory</implIndex>
<coreName>FIFO</coreName>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>78</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>261</item>
<item>262</item>
<item>263</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>1.45</m_delay>
<m_topoIndex>51</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_27">
<Value>
<Obj>
<type>0</type>
<id>41</id>
<name>br_ln250</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>250</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>250</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>1869440370</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>264</item>
<item>265</item>
<item>266</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>17</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_28">
<Value>
<Obj>
<type>0</type>
<id>43</id>
<name>pi_fsm_state_write_ln251</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>251</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>251</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56234912</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>267</item>
<item>268</item>
<item>433</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>0.38</m_delay>
<m_topoIndex>18</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>br_ln252</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>252</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>252</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>1819620128</coreId>
<rtlModuleName/>
</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>19</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>br_ln253</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>253</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>253</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56420112</coreId>
<rtlModuleName/>
</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>20</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>br_ln254</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>254</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>254</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>1397508187</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>271</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>21</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_32">
<Value>
<Obj>
<type>0</type>
<id>50</id>
<name>tmp</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>267</lineNumber>
<contextFuncName>empty</contextFuncName>
<contextNormFuncName>empty</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</first>
<second>empty</second>
</first>
<second>267</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>tmp</originalName>
<rtlName/>
<control>auto</control>
<opType>adapter</opType>
<implIndex>axi4stream</implIndex>
<coreName>axis</coreName>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>123</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>7</count>
<item_version>0</item_version>
<item>109</item>
<item>110</item>
<item>111</item>
<item>112</item>
<item>113</item>
<item>114</item>
<item>116</item>
</oprand_edges>
<opcode>nbreadreq</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="_33">
<Value>
<Obj>
<type>0</type>
<id>51</id>
<name>br_ln190</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>190</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>190</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>64</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>117</item>
<item>118</item>
<item>119</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>23</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_34">
<Value>
<Obj>
<type>0</type>
<id>53</id>
<name>empty</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>283</lineNumber>
<contextFuncName>read</contextFuncName>
<contextNormFuncName>read</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</first>
<second>read</second>
</first>
<second>283</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control>auto</control>
<opType>adapter</opType>
<implIndex>axi4stream</implIndex>
<coreName>axis</coreName>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>123</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>644</bitwidth>
</Value>
<oprand_edges>
<count>7</count>
<item_version>0</item_version>
<item>121</item>
<item>122</item>
<item>123</item>
<item>124</item>
<item>125</item>
<item>126</item>
<item>438</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>24</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_35">
<Value>
<Obj>
<type>0</type>
<id>54</id>
<name>sendWord_data_V</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>283</lineNumber>
<contextFuncName>read</contextFuncName>
<contextNormFuncName>read</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</first>
<second>read</second>
</first>
<second>283</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>sendWord.data.V</originalName>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56430512</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>127</item>
</oprand_edges>
<opcode>extractvalue</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="_36">
<Value>
<Obj>
<type>0</type>
<id>55</id>
<name>tmp_5</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>283</lineNumber>
<contextFuncName>read</contextFuncName>
<contextNormFuncName>read</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</first>
<second>read</second>
</first>
<second>283</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>tmp</originalName>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>1987013989</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>64</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>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>26</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_37">
<Value>
<Obj>
<type>0</type>
<id>56</id>
<name>sendWord_last_V_1</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>283</lineNumber>
<contextFuncName>read</contextFuncName>
<contextNormFuncName>read</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_axi_sdata.h</first>
<second>read</second>
</first>
<second>283</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>sendWord.last.V</originalName>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>574453865</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>1</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>
<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="_38">
<Value>
<Obj>
<type>0</type>
<id>57</id>
<name>p_Result_1_i</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_int_ref.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>674</lineNumber>
<contextFuncName>get</contextFuncName>
<contextNormFuncName>get</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_int_ref.h</first>
<second>get</second>
</first>
<second>674</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>p_Result_1_i_fu_203_p4</rtlName>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56337856</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>131</item>
<item>132</item>
<item>134</item>
<item>136</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>28</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_39">
<Value>
<Obj>
<type>0</type>
<id>58</id>
<name>p_Result_2_i</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_int_ref.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>674</lineNumber>
<contextFuncName>get</contextFuncName>
<contextNormFuncName>get</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_int_ref.h</first>
<second>get</second>
</first>
<second>674</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>p_Result_2_i_fu_213_p4</rtlName>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>137</item>
<item>138</item>
<item>140</item>
<item>142</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>29</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_40">
<Value>
<Obj>
<type>0</type>
<id>59</id>
<name>ethernetType_V</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_int_ref.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>312</lineNumber>
<contextFuncName>get</contextFuncName>
<contextNormFuncName>get</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_int_ref.h</first>
<second>get</second>
</first>
<second>312</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>ethernetType.V</originalName>
<rtlName>ethernetType_V_fu_223_p3</rtlName>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56264224</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>144</item>
<item>145</item>
<item>146</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>30</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_41">
<Value>
<Obj>
<type>0</type>
<id>60</id>
<name>ipVersion_V</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_int_ref.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>674</lineNumber>
<contextFuncName>get</contextFuncName>
<contextNormFuncName>get</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_int_ref.h</first>
<second>get</second>
</first>
<second>674</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>ipVersion.V</originalName>
<rtlName>ipVersion_V_fu_231_p4</rtlName>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>148</item>
<item>149</item>
<item>151</item>
<item>153</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>31</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_42">
<Value>
<Obj>
<type>0</type>
<id>61</id>
<name>ipProtocol_V</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_int_ref.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>674</lineNumber>
<contextFuncName>get</contextFuncName>
<contextNormFuncName>get</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_int_ref.h</first>
<second>get</second>
</first>
<second>674</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>ipProtocol.V</originalName>
<rtlName>ipProtocol_V_reg_361</rtlName>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56266544</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>154</item>
<item>155</item>
<item>157</item>
<item>159</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>32</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_43">
<Value>
<Obj>
<type>0</type>
<id>62</id>
<name>_ln196</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>196</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>196</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>807414784</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>6</count>
<item_version>0</item_version>
<item>160</item>
<item>161</item>
<item>163</item>
<item>164</item>
<item>166</item>
<item>167</item>
</oprand_edges>
<opcode>switch</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.49</m_delay>
<m_topoIndex>33</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_44">
<Value>
<Obj>
<type>0</type>
<id>64</id>
<name>icmp_ln1049</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_int_base.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>1049</lineNumber>
<contextFuncName>operator==&lt;32, true&gt;</contextFuncName>
<contextNormFuncName>operator_eq_32_true</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_int_base.h</first>
<second>operator==&lt;32, true&gt;</second>
</first>
<second>1049</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>icmp_ln1049_fu_251_p2</rtlName>
<control>auto</control>
<opType>icmp</opType>
<implIndex>auto</implIndex>
<coreName>Cmp</coreName>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>9</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>168</item>
<item>170</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.65</m_delay>
<m_topoIndex>34</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_45">
<Value>
<Obj>
<type>0</type>
<id>65</id>
<name>br_ln201</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>201</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>201</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56274832</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>171</item>
<item>172</item>
<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.41</m_delay>
<m_topoIndex>35</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_46">
<Value>
<Obj>
<type>0</type>
<id>67</id>
<name>_ln202</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>202</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>202</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56278120</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>6</count>
<item_version>0</item_version>
<item>174</item>
<item>175</item>
<item>177</item>
<item>178</item>
<item>180</item>
<item>181</item>
</oprand_edges>
<opcode>switch</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.49</m_delay>
<m_topoIndex>36</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_47">
<Value>
<Obj>
<type>0</type>
<id>69</id>
<name>br_ln225</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>225</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>225</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>182</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.41</m_delay>
<m_topoIndex>37</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_48">
<Value>
<Obj>
<type>0</type>
<id>71</id>
<name>icmp_ln1049_1</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_int_base.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>1049</lineNumber>
<contextFuncName>operator==&lt;8, false&gt;</contextFuncName>
<contextNormFuncName>operator_eq_8_false</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/ap_int_base.h</first>
<second>operator==&lt;8, false&gt;</second>
</first>
<second>1049</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>icmp_ln1049_1_fu_257_p2</rtlName>
<control>auto</control>
<opType>icmp</opType>
<implIndex>auto</implIndex>
<coreName>Cmp</coreName>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>9</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>195</item>
<item>197</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.58</m_delay>
<m_topoIndex>38</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_49">
<Value>
<Obj>
<type>0</type>
<id>72</id>
<name>tdest_r_V_write_ln225</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>225</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>225</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>1663920995</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>199</item>
<item>200</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>0.38</m_delay>
<m_topoIndex>39</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_50">
<Value>
<Obj>
<type>0</type>
<id>73</id>
<name>br_ln227</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>227</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>227</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>304</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>201</item>
<item>202</item>
<item>203</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.38</m_delay>
<m_topoIndex>40</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_51">
<Value>
<Obj>
<type>0</type>
<id>75</id>
<name>tdest_5_ph_i</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>1869833586</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>2</bitwidth>
</Value>
<oprand_edges>
<count>8</count>
<item_version>0</item_version>
<item>183</item>
<item>184</item>
<item>185</item>
<item>186</item>
<item>188</item>
<item>189</item>
<item>190</item>
<item>191</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="_52">
<Value>
<Obj>
<type>0</type>
<id>76</id>
<name>tdest_r_V_write_ln225</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>225</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>225</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56243936</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>192</item>
<item>193</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>0.38</m_delay>
<m_topoIndex>53</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_53">
<Value>
<Obj>
<type>0</type>
<id>77</id>
<name>br_ln227</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>227</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>227</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>194</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.38</m_delay>
<m_topoIndex>54</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_54">
<Value>
<Obj>
<type>0</type>
<id>79</id>
<name>tdest_54_i</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>2</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>204</item>
<item>205</item>
<item>206</item>
<item>207</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>55</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_55">
<Value>
<Obj>
<type>0</type>
<id>80</id>
<name>tmp_3</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/hls_stream_39.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>174</lineNumber>
<contextFuncName>write</contextFuncName>
<contextNormFuncName>write</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/hls_stream_39.h</first>
<second>write</second>
</first>
<second>174</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_3_fu_311_p6</rtlName>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56393040</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>586</bitwidth>
</Value>
<oprand_edges>
<count>6</count>
<item_version>0</item_version>
<item>209</item>
<item>210</item>
<item>212</item>
<item>213</item>
<item>214</item>
<item>215</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.00</m_delay>
<m_topoIndex>56</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_56">
<Value>
<Obj>
<type>0</type>
<id>81</id>
<name>zext_ln174_1</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/hls_stream_39.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>174</lineNumber>
<contextFuncName>write</contextFuncName>
<contextNormFuncName>write</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/hls_stream_39.h</first>
<second>write</second>
</first>
<second>174</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>zext_ln174_1_fu_324_p1</rtlName>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>1024</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>216</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>57</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_57">
<Value>
<Obj>
<type>0</type>
<id>82</id>
<name>eth_level_pkt_write_ln174</name>
<fileName>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/hls_stream_39.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>174</lineNumber>
<contextFuncName>write</contextFuncName>
<contextNormFuncName>write</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/tools/Xilinx/Vitis_HLS/2021.1/common/technology/autopilot/hls_stream_39.h</first>
<second>write</second>
</first>
<second>174</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control>auto</control>
<opType>fifo</opType>
<implIndex>memory</implIndex>
<coreName>FIFO</coreName>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>78</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>218</item>
<item>219</item>
<item>220</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>1.45</m_delay>
<m_topoIndex>58</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_58">
<Value>
<Obj>
<type>0</type>
<id>83</id>
<name>br_ln230</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>230</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>230</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56396376</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>221</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.38</m_delay>
<m_topoIndex>41</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_59">
<Value>
<Obj>
<type>0</type>
<id>85</id>
<name>br_ln0</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56398072</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>222</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.38</m_delay>
<m_topoIndex>42</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_60">
<Value>
<Obj>
<type>0</type>
<id>87</id>
<name>storemerge_i</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56395984</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>2</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>223</item>
<item>224</item>
<item>225</item>
<item>226</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>43</m_topoIndex>
<m_clusterGroupNumber>1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_61">
<Value>
<Obj>
<type>0</type>
<id>88</id>
<name>select_ln235</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>235</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>235</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>select_ln235_fu_269_p3</rtlName>
<control>auto</control>
<opType>select</opType>
<implIndex>auto_sel</implIndex>
<coreName>Sel</coreName>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>73</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>2</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>227</item>
<item>228</item>
<item>229</item>
</oprand_edges>
<opcode>select</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.27</m_delay>
<m_topoIndex>44</m_topoIndex>
<m_clusterGroupNumber>1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_62">
<Value>
<Obj>
<type>0</type>
<id>89</id>
<name>pi_fsm_state_write_ln232</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>232</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>232</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56403024</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>230</item>
<item>231</item>
<item>435</item>
</oprand_edges>
<opcode>store</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_isStartOfPath>0</m_isStartOfPath>
<m_delay>0.38</m_delay>
<m_topoIndex>45</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_63">
<Value>
<Obj>
<type>0</type>
<id>90</id>
<name>br_ln238</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>238</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>238</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>232</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>46</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
<item class_id_reference="9" object_id="_64">
<Value>
<Obj>
<type>0</type>
<id>92</id>
<name>br_ln239</name>
<fileName>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>239</lineNumber>
<contextFuncName>packet_identification</contextFuncName>
<contextNormFuncName>packet_identification</contextNormFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>/home/ubuntu/xup_vitis_network_example/NetLayers/100G-fpga-network-stack-core/synthesis_results_HMB/..//hls/packet_handler/packet_handler.cpp</first>
<second>packet_identification</second>
</first>
<second>239</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56404800</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>233</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="_65">
<Value>
<Obj>
<type>0</type>
<id>94</id>
<name>_ln0</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</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>59</m_topoIndex>
<m_clusterGroupNumber>-1</m_clusterGroupNumber>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>21</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_66">
<Value>
<Obj>
<type>2</type>
<id>99</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>62</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>2</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_67">
<Value>
<Obj>
<type>2</type>
<id>102</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>2</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_68">
<Value>
<Obj>
<type>2</type>
<id>105</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>2</bitwidth>
</Value>
<const_type>0</const_type>
<content>2</content>
</item>
<item class_id_reference="16" object_id="_69">
<Value>
<Obj>
<type>2</type>
<id>115</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_70">
<Value>
<Obj>
<type>2</type>
<id>133</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56409872</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>104</content>
</item>
<item class_id_reference="16" object_id="_71">
<Value>
<Obj>
<type>2</type>
<id>135</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>111</content>
</item>
<item class_id_reference="16" object_id="_72">
<Value>
<Obj>
<type>2</type>
<id>139</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56412888</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>96</content>
</item>
<item class_id_reference="16" object_id="_73">
<Value>
<Obj>
<type>2</type>
<id>141</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56412584</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>103</content>
</item>
<item class_id_reference="16" object_id="_74">
<Value>
<Obj>
<type>2</type>
<id>150</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56410784</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>116</content>
</item>
<item class_id_reference="16" object_id="_75">
<Value>
<Obj>
<type>2</type>
<id>152</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56413696</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>119</content>
</item>
<item class_id_reference="16" object_id="_76">
<Value>
<Obj>
<type>2</type>
<id>156</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56395632</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>184</content>
</item>
<item class_id_reference="16" object_id="_77">
<Value>
<Obj>
<type>2</type>
<id>158</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56395632</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>191</content>
</item>
<item class_id_reference="16" object_id="_78">
<Value>
<Obj>
<type>2</type>
<id>162</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<const_type>0</const_type>
<content>2054</content>
</item>
<item class_id_reference="16" object_id="_79">
<Value>
<Obj>
<type>2</type>
<id>165</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56416376</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<const_type>0</const_type>
<content>2048</content>
</item>
<item class_id_reference="16" object_id="_80">
<Value>
<Obj>
<type>2</type>
<id>169</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<const_type>0</const_type>
<content>4</content>
</item>
<item class_id_reference="16" object_id="_81">
<Value>
<Obj>
<type>2</type>
<id>176</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56417472</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>8</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>179</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56404848</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<const_type>0</const_type>
<content>6</content>
</item>
<item class_id_reference="16" object_id="_83">
<Value>
<Obj>
<type>2</type>
<id>187</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>7955819</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>2</bitwidth>
</Value>
<const_type>5</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_84">
<Value>
<Obj>
<type>2</type>
<id>196</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56417920</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>8</bitwidth>
</Value>
<const_type>0</const_type>
<content>17</content>
</item>
<item class_id_reference="16" object_id="_85">
<Value>
<Obj>
<type>2</type>
<id>198</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56348816</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>2</bitwidth>
</Value>
<const_type>0</const_type>
<content>3</content>
</item>
<item class_id_reference="16" object_id="_86">
<Value>
<Obj>
<type>2</type>
<id>211</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
</consts>
<blocks class_id="17" tracking_level="0" version="0">
<count>22</count>
<item_version>0</item_version>
<item class_id="18" tracking_level="1" version="0" object_id="_87">
<Obj>
<type>3</type>
<id>17</id>
<name>entry</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>347</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>2</count>
<item_version>0</item_version>
<item>15</item>
<item>16</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_88">
<Obj>
<type>3</type>
<id>20</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>2</count>
<item_version>0</item_version>
<item>18</item>
<item>19</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_89">
<Obj>
<type>3</type>
<id>24</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>3</count>
<item_version>0</item_version>
<item>21</item>
<item>22</item>
<item>23</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_90">
<Obj>
<type>3</type>
<id>27</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>2</count>
<item_version>0</item_version>
<item>25</item>
<item>26</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_91">
<Obj>
<type>3</type>
<id>29</id>
<name>._crit_edge10.i</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>28</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_92">
<Obj>
<type>3</type>
<id>32</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>2</count>
<item_version>0</item_version>
<item>30</item>
<item>31</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_93">
<Obj>
<type>3</type>
<id>42</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56280856</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>9</count>
<item_version>0</item_version>
<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>
</node_objs>
</item>
<item class_id_reference="18" object_id="_94">
<Obj>
<type>3</type>
<id>45</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>55917376</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>2</count>
<item_version>0</item_version>
<item>43</item>
<item>44</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_95">
<Obj>
<type>3</type>
<id>47</id>
<name>._crit_edge8.i</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>1702258035</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_96">
<Obj>
<type>3</type>
<id>49</id>
<name>._crit_edge7.i</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>48</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_97">
<Obj>
<type>3</type>
<id>52</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56404848</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>2</count>
<item_version>0</item_version>
<item>50</item>
<item>51</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_98">
<Obj>
<type>3</type>
<id>63</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56428400</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>10</count>
<item_version>0</item_version>
<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>
</node_objs>
</item>
<item class_id_reference="18" object_id="_99">
<Obj>
<type>3</type>
<id>66</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56270824</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>2</count>
<item_version>0</item_version>
<item>64</item>
<item>65</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_100">
<Obj>
<type>3</type>
<id>68</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56276208</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>67</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_101">
<Obj>
<type>3</type>
<id>70</id>
<name>.fold.split322.i</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>1936291937</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>69</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_102">
<Obj>
<type>3</type>
<id>74</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>1966088192</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>3</count>
<item_version>0</item_version>
<item>71</item>
<item>72</item>
<item>73</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_103">
<Obj>
<type>3</type>
<id>78</id>
<name>.thread.i</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56387552</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>3</count>
<item_version>0</item_version>
<item>75</item>
<item>76</item>
<item>77</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_104">
<Obj>
<type>3</type>
<id>84</id>
<name>._crit_edge5.i</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56393288</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>5</count>
<item_version>0</item_version>
<item>79</item>
<item>80</item>
<item>81</item>
<item>82</item>
<item>83</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_105">
<Obj>
<type>3</type>
<id>86</id>
<name>.thread5.i</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>1414419794</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>85</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_106">
<Obj>
<type>3</type>
<id>91</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56398832</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>4</count>
<item_version>0</item_version>
<item>87</item>
<item>88</item>
<item>89</item>
<item>90</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_107">
<Obj>
<type>3</type>
<id>93</id>
<name>._crit_edge2.i</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>56404304</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>92</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_108">
<Obj>
<type>3</type>
<id>95</id>
<name>packet_identification.exit</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<contextNormFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<control/>
<opType/>
<implIndex/>
<coreName/>
<isStorage>0</isStorage>
<storageDepth>0</storageDepth>
<coreId>0</coreId>
<rtlModuleName/>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>94</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>198</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_109">
<id>96</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>15</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_110">
<id>97</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>16</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_111">
<id>98</id>
<edge_type>2</edge_type>
<source_obj>95</source_obj>
<sink_obj>16</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_112">
<id>100</id>
<edge_type>1</edge_type>
<source_obj>99</source_obj>
<sink_obj>16</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_113">
<id>101</id>
<edge_type>2</edge_type>
<source_obj>52</source_obj>
<sink_obj>16</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_114">
<id>103</id>
<edge_type>1</edge_type>
<source_obj>102</source_obj>
<sink_obj>16</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_115">
<id>104</id>
<edge_type>2</edge_type>
<source_obj>32</source_obj>
<sink_obj>16</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_116">
<id>106</id>
<edge_type>1</edge_type>
<source_obj>105</source_obj>
<sink_obj>16</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_117">
<id>107</id>
<edge_type>2</edge_type>
<source_obj>20</source_obj>
<sink_obj>16</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_118">
<id>110</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>50</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_119">
<id>111</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>50</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_120">
<id>112</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>50</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_121">
<id>113</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>50</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_122">
<id>114</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>50</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_123">
<id>116</id>
<edge_type>1</edge_type>
<source_obj>115</source_obj>
<sink_obj>50</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_124">
<id>117</id>
<edge_type>1</edge_type>
<source_obj>50</source_obj>
<sink_obj>51</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_125">
<id>118</id>
<edge_type>2</edge_type>
<source_obj>93</source_obj>
<sink_obj>51</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_126">
<id>119</id>
<edge_type>2</edge_type>
<source_obj>63</source_obj>
<sink_obj>51</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_127">
<id>122</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>53</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_128">
<id>123</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>53</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_129">
<id>124</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>53</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_130">
<id>125</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>53</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_131">
<id>126</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>53</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_132">
<id>127</id>
<edge_type>1</edge_type>
<source_obj>53</source_obj>
<sink_obj>54</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_133">
<id>128</id>
<edge_type>1</edge_type>
<source_obj>53</source_obj>
<sink_obj>55</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_134">
<id>129</id>
<edge_type>1</edge_type>
<source_obj>53</source_obj>
<sink_obj>56</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_135">
<id>132</id>
<edge_type>1</edge_type>
<source_obj>54</source_obj>
<sink_obj>57</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_136">
<id>134</id>
<edge_type>1</edge_type>
<source_obj>133</source_obj>
<sink_obj>57</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_137">
<id>136</id>
<edge_type>1</edge_type>
<source_obj>135</source_obj>
<sink_obj>57</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_138">
<id>138</id>
<edge_type>1</edge_type>
<source_obj>54</source_obj>
<sink_obj>58</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_139">
<id>140</id>
<edge_type>1</edge_type>
<source_obj>139</source_obj>
<sink_obj>58</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_140">
<id>142</id>
<edge_type>1</edge_type>
<source_obj>141</source_obj>
<sink_obj>58</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_141">
<id>145</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="_142">
<id>146</id>
<edge_type>1</edge_type>
<source_obj>57</source_obj>
<sink_obj>59</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_143">
<id>149</id>
<edge_type>1</edge_type>
<source_obj>54</source_obj>
<sink_obj>60</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_144">
<id>151</id>
<edge_type>1</edge_type>
<source_obj>150</source_obj>
<sink_obj>60</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_145">
<id>153</id>
<edge_type>1</edge_type>
<source_obj>152</source_obj>
<sink_obj>60</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_146">
<id>155</id>
<edge_type>1</edge_type>
<source_obj>54</source_obj>
<sink_obj>61</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_147">
<id>157</id>
<edge_type>1</edge_type>
<source_obj>156</source_obj>
<sink_obj>61</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_148">
<id>159</id>
<edge_type>1</edge_type>
<source_obj>158</source_obj>
<sink_obj>61</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_149">
<id>160</id>
<edge_type>1</edge_type>
<source_obj>59</source_obj>
<sink_obj>62</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_150">
<id>161</id>
<edge_type>2</edge_type>
<source_obj>86</source_obj>
<sink_obj>62</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_151">
<id>163</id>
<edge_type>1</edge_type>
<source_obj>162</source_obj>
<sink_obj>62</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_152">
<id>164</id>
<edge_type>2</edge_type>
<source_obj>78</source_obj>
<sink_obj>62</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_153">
<id>166</id>
<edge_type>1</edge_type>
<source_obj>165</source_obj>
<sink_obj>62</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_154">
<id>167</id>
<edge_type>2</edge_type>
<source_obj>66</source_obj>
<sink_obj>62</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_155">
<id>168</id>
<edge_type>1</edge_type>
<source_obj>60</source_obj>
<sink_obj>64</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_156">
<id>170</id>
<edge_type>1</edge_type>
<source_obj>169</source_obj>
<sink_obj>64</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_157">
<id>171</id>
<edge_type>1</edge_type>
<source_obj>64</source_obj>
<sink_obj>65</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_158">
<id>172</id>
<edge_type>2</edge_type>
<source_obj>78</source_obj>
<sink_obj>65</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_159">
<id>173</id>
<edge_type>2</edge_type>
<source_obj>68</source_obj>
<sink_obj>65</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_160">
<id>174</id>
<edge_type>1</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="_161">
<id>175</id>
<edge_type>2</edge_type>
<source_obj>74</source_obj>
<sink_obj>67</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_162">
<id>177</id>
<edge_type>1</edge_type>
<source_obj>176</source_obj>
<sink_obj>67</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_163">
<id>178</id>
<edge_type>2</edge_type>
<source_obj>78</source_obj>
<sink_obj>67</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_164">
<id>180</id>
<edge_type>1</edge_type>
<source_obj>179</source_obj>
<sink_obj>67</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_165">
<id>181</id>
<edge_type>2</edge_type>
<source_obj>70</source_obj>
<sink_obj>67</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_166">
<id>182</id>
<edge_type>2</edge_type>
<source_obj>78</source_obj>
<sink_obj>69</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_167">
<id>183</id>
<edge_type>1</edge_type>
<source_obj>105</source_obj>
<sink_obj>75</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_168">
<id>184</id>
<edge_type>2</edge_type>
<source_obj>70</source_obj>
<sink_obj>75</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_169">
<id>185</id>
<edge_type>1</edge_type>
<source_obj>99</source_obj>
<sink_obj>75</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_170">
<id>186</id>
<edge_type>2</edge_type>
<source_obj>63</source_obj>
<sink_obj>75</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_171">
<id>188</id>
<edge_type>1</edge_type>
<source_obj>187</source_obj>
<sink_obj>75</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_172">
<id>189</id>
<edge_type>2</edge_type>
<source_obj>66</source_obj>
<sink_obj>75</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_173">
<id>190</id>
<edge_type>1</edge_type>
<source_obj>102</source_obj>
<sink_obj>75</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_174">
<id>191</id>
<edge_type>2</edge_type>
<source_obj>68</source_obj>
<sink_obj>75</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_175">
<id>192</id>
<edge_type>1</edge_type>
<source_obj>75</source_obj>
<sink_obj>76</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_176">
<id>193</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>76</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_177">
<id>194</id>
<edge_type>2</edge_type>
<source_obj>84</source_obj>
<sink_obj>77</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_178">
<id>195</id>
<edge_type>1</edge_type>
<source_obj>61</source_obj>
<sink_obj>71</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_179">
<id>197</id>
<edge_type>1</edge_type>
<source_obj>196</source_obj>
<sink_obj>71</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_180">
<id>199</id>
<edge_type>1</edge_type>
<source_obj>198</source_obj>
<sink_obj>72</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_181">
<id>200</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>72</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_182">
<id>201</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="_183">
<id>202</id>
<edge_type>2</edge_type>
<source_obj>86</source_obj>
<sink_obj>73</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_184">
<id>203</id>
<edge_type>2</edge_type>
<source_obj>84</source_obj>
<sink_obj>73</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_185">
<id>204</id>
<edge_type>1</edge_type>
<source_obj>75</source_obj>
<sink_obj>79</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_186">
<id>205</id>
<edge_type>2</edge_type>
<source_obj>78</source_obj>
<sink_obj>79</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_187">
<id>206</id>
<edge_type>1</edge_type>
<source_obj>198</source_obj>
<sink_obj>79</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_188">
<id>207</id>
<edge_type>2</edge_type>
<source_obj>74</source_obj>
<sink_obj>79</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_189">
<id>210</id>
<edge_type>1</edge_type>
<source_obj>79</source_obj>
<sink_obj>80</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_190">
<id>212</id>
<edge_type>1</edge_type>
<source_obj>211</source_obj>
<sink_obj>80</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_191">
<id>213</id>
<edge_type>1</edge_type>
<source_obj>56</source_obj>
<sink_obj>80</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_192">
<id>214</id>
<edge_type>1</edge_type>
<source_obj>55</source_obj>
<sink_obj>80</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_193">
<id>215</id>
<edge_type>1</edge_type>
<source_obj>54</source_obj>
<sink_obj>80</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_194">
<id>216</id>
<edge_type>1</edge_type>
<source_obj>80</source_obj>
<sink_obj>81</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_195">
<id>219</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>82</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_196">
<id>220</id>
<edge_type>1</edge_type>
<source_obj>81</source_obj>
<sink_obj>82</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_197">
<id>221</id>
<edge_type>2</edge_type>
<source_obj>91</source_obj>
<sink_obj>83</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_198">
<id>222</id>
<edge_type>2</edge_type>
<source_obj>91</source_obj>
<sink_obj>85</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_199">
<id>223</id>
<edge_type>1</edge_type>
<source_obj>102</source_obj>
<sink_obj>87</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_200">
<id>224</id>
<edge_type>2</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="_201">
<id>225</id>
<edge_type>1</edge_type>
<source_obj>105</source_obj>
<sink_obj>87</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_202">
<id>226</id>
<edge_type>2</edge_type>
<source_obj>86</source_obj>
<sink_obj>87</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_203">
<id>227</id>
<edge_type>1</edge_type>
<source_obj>56</source_obj>
<sink_obj>88</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_204">
<id>228</id>
<edge_type>1</edge_type>
<source_obj>99</source_obj>
<sink_obj>88</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_205">
<id>229</id>
<edge_type>1</edge_type>
<source_obj>87</source_obj>
<sink_obj>88</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_206">
<id>230</id>
<edge_type>1</edge_type>
<source_obj>88</source_obj>
<sink_obj>89</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_207">
<id>231</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>89</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_208">
<id>232</id>
<edge_type>2</edge_type>
<source_obj>93</source_obj>
<sink_obj>90</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_209">
<id>233</id>
<edge_type>2</edge_type>
<source_obj>95</source_obj>
<sink_obj>92</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_210">
<id>235</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>30</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_211">
<id>236</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>30</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>3</source_obj>
<sink_obj>30</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_213">
<id>238</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>30</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_214">
<id>239</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>30</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_215">
<id>240</id>
<edge_type>1</edge_type>
<source_obj>115</source_obj>
<sink_obj>30</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_216">
<id>241</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>31</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_217">
<id>242</id>
<edge_type>2</edge_type>
<source_obj>49</source_obj>
<sink_obj>31</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_218">
<id>243</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="_219">
<id>245</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>33</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_220">
<id>246</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>33</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>3</source_obj>
<sink_obj>33</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_222">
<id>248</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>33</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_223">
<id>249</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>33</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>33</source_obj>
<sink_obj>34</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>33</source_obj>
<sink_obj>35</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>33</source_obj>
<sink_obj>36</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>7</source_obj>
<sink_obj>37</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_228">
<id>255</id>
<edge_type>1</edge_type>
<source_obj>37</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_229">
<id>256</id>
<edge_type>1</edge_type>
<source_obj>211</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_230">
<id>257</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="_231">
<id>258</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_232">
<id>259</id>
<edge_type>1</edge_type>
<source_obj>34</source_obj>
<sink_obj>38</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_233">
<id>260</id>
<edge_type>1</edge_type>
<source_obj>38</source_obj>
<sink_obj>39</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_234">
<id>262</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>40</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_235">
<id>263</id>
<edge_type>1</edge_type>
<source_obj>39</source_obj>
<sink_obj>40</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_236">
<id>264</id>
<edge_type>1</edge_type>
<source_obj>36</source_obj>
<sink_obj>41</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_237">
<id>265</id>
<edge_type>2</edge_type>
<source_obj>47</source_obj>
<sink_obj>41</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_238">
<id>266</id>
<edge_type>2</edge_type>
<source_obj>45</source_obj>
<sink_obj>41</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_239">
<id>267</id>
<edge_type>1</edge_type>
<source_obj>99</source_obj>
<sink_obj>43</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_240">
<id>268</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>43</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_241">
<id>269</id>
<edge_type>2</edge_type>
<source_obj>47</source_obj>
<sink_obj>44</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_242">
<id>270</id>
<edge_type>2</edge_type>
<source_obj>49</source_obj>
<sink_obj>46</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_243">
<id>271</id>
<edge_type>2</edge_type>
<source_obj>95</source_obj>
<sink_obj>48</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_244">
<id>273</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_245">
<id>274</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_246">
<id>275</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_247">
<id>276</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_248">
<id>277</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_249">
<id>278</id>
<edge_type>1</edge_type>
<source_obj>115</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_250">
<id>279</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>19</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_251">
<id>280</id>
<edge_type>2</edge_type>
<source_obj>95</source_obj>
<sink_obj>19</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_252">
<id>281</id>
<edge_type>2</edge_type>
<source_obj>24</source_obj>
<sink_obj>19</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_253">
<id>283</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>21</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_254">
<id>284</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>21</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_255">
<id>285</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>21</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_256">
<id>286</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>21</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_257">
<id>287</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>21</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_258">
<id>288</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>22</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_259">
<id>289</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="_260">
<id>290</id>
<edge_type>2</edge_type>
<source_obj>29</source_obj>
<sink_obj>23</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_261">
<id>291</id>
<edge_type>2</edge_type>
<source_obj>27</source_obj>
<sink_obj>23</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_262">
<id>292</id>
<edge_type>1</edge_type>
<source_obj>99</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_263">
<id>293</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_264">
<id>294</id>
<edge_type>2</edge_type>
<source_obj>29</source_obj>
<sink_obj>26</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_265">
<id>295</id>
<edge_type>2</edge_type>
<source_obj>95</source_obj>
<sink_obj>28</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_266">
<id>398</id>
<edge_type>2</edge_type>
<source_obj>17</source_obj>
<sink_obj>95</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_267">
<id>399</id>
<edge_type>2</edge_type>
<source_obj>17</source_obj>
<sink_obj>52</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_268">
<id>400</id>
<edge_type>2</edge_type>
<source_obj>17</source_obj>
<sink_obj>32</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_269">
<id>401</id>
<edge_type>2</edge_type>
<source_obj>17</source_obj>
<sink_obj>20</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_270">
<id>402</id>
<edge_type>2</edge_type>
<source_obj>20</source_obj>
<sink_obj>24</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_271">
<id>403</id>
<edge_type>2</edge_type>
<source_obj>20</source_obj>
<sink_obj>95</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_272">
<id>404</id>
<edge_type>2</edge_type>
<source_obj>24</source_obj>
<sink_obj>27</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_273">
<id>405</id>
<edge_type>2</edge_type>
<source_obj>24</source_obj>
<sink_obj>29</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_274">
<id>406</id>
<edge_type>2</edge_type>
<source_obj>27</source_obj>
<sink_obj>29</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_275">
<id>407</id>
<edge_type>2</edge_type>
<source_obj>29</source_obj>
<sink_obj>95</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_276">
<id>408</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="_277">
<id>409</id>
<edge_type>2</edge_type>
<source_obj>32</source_obj>
<sink_obj>49</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_278">
<id>410</id>
<edge_type>2</edge_type>
<source_obj>42</source_obj>
<sink_obj>45</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_279">
<id>411</id>
<edge_type>2</edge_type>
<source_obj>42</source_obj>
<sink_obj>47</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_280">
<id>412</id>
<edge_type>2</edge_type>
<source_obj>45</source_obj>
<sink_obj>47</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_281">
<id>413</id>
<edge_type>2</edge_type>
<source_obj>47</source_obj>
<sink_obj>49</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_282">
<id>414</id>
<edge_type>2</edge_type>
<source_obj>49</source_obj>
<sink_obj>95</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_283">
<id>415</id>
<edge_type>2</edge_type>
<source_obj>52</source_obj>
<sink_obj>63</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_284">
<id>416</id>
<edge_type>2</edge_type>
<source_obj>52</source_obj>
<sink_obj>93</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_285">
<id>417</id>
<edge_type>2</edge_type>
<source_obj>63</source_obj>
<sink_obj>86</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_286">
<id>418</id>
<edge_type>2</edge_type>
<source_obj>63</source_obj>
<sink_obj>78</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_287">
<id>419</id>
<edge_type>2</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="_288">
<id>420</id>
<edge_type>2</edge_type>
<source_obj>66</source_obj>
<sink_obj>68</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_289">
<id>421</id>
<edge_type>2</edge_type>
<source_obj>66</source_obj>
<sink_obj>78</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_290">
<id>422</id>
<edge_type>2</edge_type>
<source_obj>68</source_obj>
<sink_obj>74</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_291">
<id>423</id>
<edge_type>2</edge_type>
<source_obj>68</source_obj>
<sink_obj>78</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_292">
<id>424</id>
<edge_type>2</edge_type>
<source_obj>68</source_obj>
<sink_obj>70</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_293">
<id>425</id>
<edge_type>2</edge_type>
<source_obj>70</source_obj>
<sink_obj>78</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_294">
<id>426</id>
<edge_type>2</edge_type>
<source_obj>74</source_obj>
<sink_obj>84</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_295">
<id>427</id>
<edge_type>2</edge_type>
<source_obj>74</source_obj>
<sink_obj>86</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_296">
<id>428</id>
<edge_type>2</edge_type>
<source_obj>78</source_obj>
<sink_obj>84</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_297">
<id>429</id>
<edge_type>2</edge_type>
<source_obj>84</source_obj>
<sink_obj>91</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_298">
<id>430</id>
<edge_type>2</edge_type>
<source_obj>86</source_obj>
<sink_obj>91</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_299">
<id>431</id>
<edge_type>2</edge_type>
<source_obj>91</source_obj>
<sink_obj>93</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_300">
<id>432</id>
<edge_type>2</edge_type>
<source_obj>93</source_obj>
<sink_obj>95</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_301">
<id>433</id>
<edge_type>4</edge_type>
<source_obj>15</source_obj>
<sink_obj>43</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_302">
<id>434</id>
<edge_type>4</edge_type>
<source_obj>15</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_303">
<id>435</id>
<edge_type>4</edge_type>
<source_obj>15</source_obj>
<sink_obj>89</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_304">
<id>436</id>
<edge_type>4</edge_type>
<source_obj>18</source_obj>
<sink_obj>21</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_305">
<id>437</id>
<edge_type>4</edge_type>
<source_obj>30</source_obj>
<sink_obj>33</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_306">
<id>438</id>
<edge_type>4</edge_type>
<source_obj>50</source_obj>
<sink_obj>53</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="21" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="22" tracking_level="1" version="0" object_id="_307">
<mId>1</mId>
<mTag>packet_identification</mTag>
<mNormTag>packet_identification</mNormTag>
<mType>0</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>22</count>
<item_version>0</item_version>
<item>17</item>
<item>20</item>
<item>24</item>
<item>27</item>
<item>29</item>
<item>32</item>
<item>42</item>
<item>45</item>
<item>47</item>
<item>49</item>
<item>52</item>
<item>63</item>
<item>66</item>
<item>68</item>
<item>70</item>
<item>74</item>
<item>78</item>
<item>84</item>
<item>86</item>
<item>91</item>
<item>93</item>
<item>95</item>
</basic_blocks>
<mII>1</mII>
<mDepth>2</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>1</mMinLatency>
<mMaxLatency>1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"/>
</item>
</cdfg_regions>
<fsm class_id="24" tracking_level="1" version="0" object_id="_308">
<states class_id="25" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="26" tracking_level="1" version="0" object_id="_309">
<id>1</id>
<operations class_id="27" tracking_level="0" version="0">
<count>53</count>
<item_version>0</item_version>
<item class_id="28" tracking_level="1" version="0" object_id="_310">
<id>9</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_311">
<id>10</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_312">
<id>11</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_313">
<id>12</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_314">
<id>13</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_315">
<id>14</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_316">
<id>15</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_317">
<id>16</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_318">
<id>18</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_319">
<id>19</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_320">
<id>21</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_321">
<id>22</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_322">
<id>23</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_323">
<id>25</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_324">
<id>26</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_325">
<id>28</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_326">
<id>30</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_327">
<id>31</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_328">
<id>33</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_329">
<id>34</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_330">
<id>35</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_331">
<id>36</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_332">
<id>41</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_333">
<id>43</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_334">
<id>44</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_335">
<id>46</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_336">
<id>48</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_337">
<id>50</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_338">
<id>51</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_339">
<id>53</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_340">
<id>54</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_341">
<id>55</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_342">
<id>56</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_343">
<id>57</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_344">
<id>58</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_345">
<id>59</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_346">
<id>60</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_347">
<id>61</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_348">
<id>62</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_349">
<id>64</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_350">
<id>65</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_351">
<id>67</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_352">
<id>69</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_353">
<id>71</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_354">
<id>72</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_355">
<id>73</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_356">
<id>83</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_357">
<id>85</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_358">
<id>87</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_359">
<id>88</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_360">
<id>89</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_361">
<id>90</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_362">
<id>92</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_363">
<id>2</id>
<operations>
<count>12</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_364">
<id>37</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_365">
<id>38</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_366">
<id>39</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_367">
<id>40</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_368">
<id>75</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_369">
<id>76</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_370">
<id>77</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_371">
<id>79</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_372">
<id>80</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_373">
<id>81</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_374">
<id>82</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>
</operations>
</item>
</states>
<transitions class_id="29" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="30" tracking_level="1" version="0" object_id="_376">
<inState>1</inState>
<outState>2</outState>
<condition class_id="31" tracking_level="0" version="0">
<id>-1</id>
<sop class_id="32" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="33" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
</transitions>
</fsm>
<res class_id="34" tracking_level="1" version="0" object_id="_377">
<dp_component_resource class_id="35" tracking_level="0" version="0">
<count>5</count>
<item_version>0</item_version>
<item class_id="36" tracking_level="0" version="0">
<first>regslice_both_s_axis_V_data_V_U (packet_handler_regslice_both)</first>
<second class_id="37" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>regslice_both_s_axis_V_dest_V_U (packet_handler_regslice_both)</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>regslice_both_s_axis_V_keep_V_U (packet_handler_regslice_both)</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>regslice_both_s_axis_V_last_V_U (packet_handler_regslice_both)</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>regslice_both_s_axis_V_strb_V_U (packet_handler_regslice_both)</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
</dp_component_resource>
<dp_expression_resource>
<count>21</count>
<item_version>0</item_version>
<item>
<first>ap_block_pp0_stage0_01001 ( or ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item class_id="38" tracking_level="0" version="0">
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_block_state1_pp0_stage0_iter0 ( or ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_block_state2_pp0_stage0_iter1 ( or ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_condition_173 ( and ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_condition_214 ( and ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_condition_233 ( and ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_condition_235 ( and ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_condition_241 ( and ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_condition_275 ( and ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_condition_458 ( and ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_condition_463 ( and ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_enable_pp0 ( xor ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>2</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_predicate_op13_read_state1 ( and ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_predicate_op21_read_state1 ( and ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_predicate_op32_read_state1 ( and ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_predicate_op59_write_state2 ( and ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_predicate_op66_write_state2 ( or ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>grp_nbreadreq_fu_86_p7 ( and ) </first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>icmp_ln1049_1_fu_257_p2 ( icmp ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>8</second>
</item>
<item>
<first>(1P1)</first>
<second>5</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>11</second>
</item>
</second>
</item>
<item>
<first>icmp_ln1049_fu_251_p2 ( icmp ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>4</second>
</item>
<item>
<first>(1P1)</first>
<second>3</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>select_ln235_fu_269_p3 ( select ) </first>
<second>
<count>5</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>(2P2)</first>
<second>2</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
</dp_expression_resource>
<dp_fifo_resource>
<count>0</count>
<item_version>0</item_version>
</dp_fifo_resource>
<dp_memory_resource>
<count>0</count>
<item_version>0</item_version>
</dp_memory_resource>
<dp_multiplexer_resource>
<count>11</count>
<item_version>0</item_version>
<item>
<first>ap_done</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>2</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>ap_phi_mux_storemerge_i_phi_fu_126_p4</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>3</second>
</item>
<item>
<first>(1Bits)</first>
<second>2</second>
</item>
<item>
<first>(2Count)</first>
<second>6</second>
</item>
<item>
<first>LUT</first>
<second>14</second>
</item>
</second>
</item>
<item>
<first>ap_phi_mux_tdest_54_i_phi_fu_159_p4</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>2</second>
</item>
<item>
<first>(2Count)</first>
<second>4</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>ap_phi_reg_pp0_iter1_tdest_54_i_reg_155</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>2</second>
</item>
<item>
<first>(2Count)</first>
<second>4</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>ap_phi_reg_pp0_iter1_tdest_5_ph_i_reg_134</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>4</second>
</item>
<item>
<first>(1Bits)</first>
<second>2</second>
</item>
<item>
<first>(2Count)</first>
<second>8</second>
</item>
<item>
<first>LUT</first>
<second>20</second>
</item>
</second>
</item>
<item>
<first>eth_level_pkt_blk_n</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>2</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>eth_level_pkt_din</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>3</second>
</item>
<item>
<first>(1Bits)</first>
<second>1024</second>
</item>
<item>
<first>(2Count)</first>
<second>3072</second>
</item>
<item>
<first>LUT</first>
<second>14</second>
</item>
</second>
</item>
<item>
<first>pi_fsm_state</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>2</second>
</item>
<item>
<first>(2Count)</first>
<second>4</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>real_start</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>2</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>s_axis_TDATA_blk_n</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>2</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>tdest_r_V</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>2</second>
</item>
<item>
<first>(2Count)</first>
<second>4</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
</dp_multiplexer_resource>
<dp_register_resource>
<count>19</count>
<item_version>0</item_version>
<item>
<first>ap_CS_fsm</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>1</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>ap_done_reg</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>1</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>ap_enable_reg_pp0_iter1</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>1</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>ap_phi_reg_pp0_iter1_tdest_54_i_reg_155</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>2</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_phi_reg_pp0_iter1_tdest_5_ph_i_reg_134</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>2</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ethernetType_V_reg_357</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>16</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>16</second>
</item>
</second>
</item>
<item>
<first>icmp_ln1049_1_reg_369</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>icmp_ln1049_reg_365</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>ipProtocol_V_reg_361</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>8</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>8</second>
</item>
</second>
</item>
<item>
<first>pi_fsm_state</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>2</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>pi_fsm_state_load_reg_329</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>2</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>reg_179</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>512</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>512</second>
</item>
</second>
</item>
<item>
<first>reg_183</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>64</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>64</second>
</item>
</second>
</item>
<item>
<first>sendWord_last_V_1_reg_352</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>1</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>start_once_reg</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>1</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>tdest_r_V</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>2</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>tmp_11_reg_343</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>1</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>tmp_1_reg_339</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>1</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>tmp_reg_348</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>5</count>
<item_version>0</item_version>
<item>
<first>regslice_both_s_axis_V_data_V_U</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>regslice_both_s_axis_V_dest_V_U</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>regslice_both_s_axis_V_keep_V_U</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>regslice_both_s_axis_V_last_V_U</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>regslice_both_s_axis_V_strb_V_U</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
</dp_dsp_resource>
<dp_component_map class_id="39" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_component_map>
<dp_expression_map>
<count>3</count>
<item_version>0</item_version>
<item class_id="40" tracking_level="0" version="0">
<first>icmp_ln1049_1_fu_257_p2 ( icmp ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>71</item>
</second>
</item>
<item>
<first>icmp_ln1049_fu_251_p2 ( icmp ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>64</item>
</second>
</item>
<item>
<first>select_ln235_fu_269_p3 ( select ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>88</item>
</second>
</item>
</dp_expression_map>
<dp_fifo_map>
<count>0</count>
<item_version>0</item_version>
</dp_fifo_map>
<dp_memory_map>
<count>0</count>
<item_version>0</item_version>
</dp_memory_map>
</res>
<node_label_latency class_id="41" tracking_level="0" version="0">
<count>59</count>
<item_version>0</item_version>
<item class_id="42" tracking_level="0" version="0">
<first>15</first>
<second class_id="43" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>16</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>18</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>19</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>21</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>22</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>23</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>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>28</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>30</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>31</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>33</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>34</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>35</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>36</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>37</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>38</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>39</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>40</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>41</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>43</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>44</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>46</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>48</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>50</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>51</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>53</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>54</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>55</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>56</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>57</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>58</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>59</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>60</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>61</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>62</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>64</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>65</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>67</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>69</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>71</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>72</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>73</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>75</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>76</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>77</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>79</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>80</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>81</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>82</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>83</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>85</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>87</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>88</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>89</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>90</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>92</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>94</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="44" tracking_level="0" version="0">
<count>22</count>
<item_version>0</item_version>
<item class_id="45" tracking_level="0" version="0">
<first>17</first>
<second class_id="46" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>20</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>27</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>32</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>42</first>
<second>
<first>0</first>
<second>1</second>
</second>
</item>
<item>
<first>45</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>47</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>49</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>52</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>63</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>66</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>68</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>70</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>74</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>78</first>
<second>
<first>0</first>
<second>1</second>
</second>
</item>
<item>
<first>84</first>
<second>
<first>0</first>
<second>1</second>
</second>
</item>
<item>
<first>86</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>91</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>93</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>95</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="47" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="48" tracking_level="1" version="0" object_id="_378">
<region_name>packet_identification</region_name>
<basic_blocks>
<count>22</count>
<item_version>0</item_version>
<item>17</item>
<item>20</item>
<item>24</item>
<item>27</item>
<item>29</item>
<item>32</item>
<item>42</item>
<item>45</item>
<item>47</item>
<item>49</item>
<item>52</item>
<item>63</item>
<item>66</item>
<item>68</item>
<item>70</item>
<item>74</item>
<item>78</item>
<item>84</item>
<item>86</item>
<item>91</item>
<item>93</item>
<item>95</item>
</basic_blocks>
<nodes>
<count>0</count>
<item_version>0</item_version>
</nodes>
<anchor_node>-1</anchor_node>
<region_type>8</region_type>
<interval>1</interval>
<pipe_depth>2</pipe_depth>
<mDBIIViolationVec class_id="49" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</mDBIIViolationVec>
</item>
</regions>
<dp_fu_nodes class_id="50" tracking_level="0" version="0">
<count>28</count>
<item_version>0</item_version>
<item class_id="51" tracking_level="0" version="0">
<first>86</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>18</item>
<item>30</item>
<item>50</item>
</second>
</item>
<item>
<first>102</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>21</item>
<item>33</item>
<item>53</item>
</second>
</item>
<item>
<first>116</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>40</item>
<item>82</item>
</second>
</item>
<item>
<first>126</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>87</item>
</second>
</item>
<item>
<first>141</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>75</item>
</second>
</item>
<item>
<first>159</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>79</item>
</second>
</item>
<item>
<first>167</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>22</item>
<item>36</item>
<item>56</item>
</second>
</item>
<item>
<first>171</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>34</item>
<item>54</item>
</second>
</item>
<item>
<first>175</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>35</item>
<item>55</item>
</second>
</item>
<item>
<first>187</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>191</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>197</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>43</item>
</second>
</item>
<item>
<first>203</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>57</item>
</second>
</item>
<item>
<first>213</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>58</item>
</second>
</item>
<item>
<first>223</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>59</item>
</second>
</item>
<item>
<first>231</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>60</item>
</second>
</item>
<item>
<first>241</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>61</item>
</second>
</item>
<item>
<first>251</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>64</item>
</second>
</item>
<item>
<first>257</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>71</item>
</second>
</item>
<item>
<first>263</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>72</item>
</second>
</item>
<item>
<first>269</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>88</item>
</second>
</item>
<item>
<first>277</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>89</item>
</second>
</item>
<item>
<first>283</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>287</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>38</item>
</second>
</item>
<item>
<first>300</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</second>
</item>
<item>
<first>305</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>76</item>
</second>
</item>
<item>
<first>311</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>80</item>
</second>
</item>
<item>
<first>324</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>81</item>
</second>
</item>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="53" tracking_level="0" version="0">
<count>18</count>
<item_version>0</item_version>
<item class_id="54" tracking_level="0" version="0">
<first>ethernetType_V_fu_223</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>59</item>
</second>
</item>
<item>
<first>grp_fu_167</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>22</item>
<item>36</item>
<item>56</item>
</second>
</item>
<item>
<first>grp_fu_171</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>34</item>
<item>54</item>
</second>
</item>
<item>
<first>grp_fu_175</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>35</item>
<item>55</item>
</second>
</item>
<item>
<first>icmp_ln1049_1_fu_257</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>71</item>
</second>
</item>
<item>
<first>icmp_ln1049_fu_251</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>64</item>
</second>
</item>
<item>
<first>ipProtocol_V_fu_241</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>61</item>
</second>
</item>
<item>
<first>ipVersion_V_fu_231</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>60</item>
</second>
</item>
<item>
<first>p_Result_1_i_fu_203</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>57</item>
</second>
</item>
<item>
<first>p_Result_2_i_fu_213</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>58</item>
</second>
</item>
<item>
<first>select_ln235_fu_269</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>88</item>
</second>
</item>
<item>
<first>storemerge_i_phi_fu_126</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>87</item>
</second>
</item>
<item>
<first>tdest_54_i_phi_fu_159</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>79</item>
</second>
</item>
<item>
<first>tdest_5_ph_i_phi_fu_141</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>75</item>
</second>
</item>
<item>
<first>tmp_3_fu_311</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>80</item>
</second>
</item>
<item>
<first>tmp_s_fu_287</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>38</item>
</second>
</item>
<item>
<first>zext_ln174_1_fu_324</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>81</item>
</second>
</item>
<item>
<first>zext_ln174_fu_300</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</second>
</item>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_module>
<dp_fu_nodes_io>
<count>10</count>
<item_version>0</item_version>
<item>
<first>grp_nbreadreq_fu_86</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>18</item>
<item>30</item>
<item>50</item>
</second>
</item>
<item>
<first>grp_read_fu_102</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>21</item>
<item>33</item>
<item>53</item>
</second>
</item>
<item>
<first>grp_write_fu_116</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>40</item>
<item>82</item>
</second>
</item>
<item>
<first>pi_fsm_state_load_load_fu_187</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>sendWord_dest_V_load_fu_283</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>store_ln225_store_fu_263</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>72</item>
</second>
</item>
<item>
<first>store_ln225_store_fu_305</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>76</item>
</second>
</item>
<item>
<first>store_ln232_store_fu_277</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>89</item>
</second>
</item>
<item>
<first>store_ln251_store_fu_197</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>43</item>
</second>
</item>
<item>
<first>store_ln259_store_fu_191</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</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="55" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>14</count>
<item_version>0</item_version>
<item>
<first>123</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>87</item>
</second>
</item>
<item>
<first>134</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>75</item>
</second>
</item>
<item>
<first>155</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>79</item>
</second>
</item>
<item>
<first>179</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>34</item>
<item>54</item>
</second>
</item>
<item>
<first>183</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>35</item>
<item>55</item>
</second>
</item>
<item>
<first>329</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>339</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>343</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>348</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>50</item>
</second>
</item>
<item>
<first>352</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>56</item>
</second>
</item>
<item>
<first>357</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>59</item>
</second>
</item>
<item>
<first>361</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>61</item>
</second>
</item>
<item>
<first>365</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>64</item>
</second>
</item>
<item>
<first>369</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>71</item>
</second>
</item>
</dp_reg_nodes>
<dp_regname_nodes>
<count>14</count>
<item_version>0</item_version>
<item>
<first>ethernetType_V_reg_357</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>59</item>
</second>
</item>
<item>
<first>icmp_ln1049_1_reg_369</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>71</item>
</second>
</item>
<item>
<first>icmp_ln1049_reg_365</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>64</item>
</second>
</item>
<item>
<first>ipProtocol_V_reg_361</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>61</item>
</second>
</item>
<item>
<first>pi_fsm_state_load_reg_329</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</second>
</item>
<item>
<first>reg_179</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>34</item>
<item>54</item>
</second>
</item>
<item>
<first>reg_183</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>35</item>
<item>55</item>
</second>
</item>
<item>
<first>sendWord_last_V_1_reg_352</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>56</item>
</second>
</item>
<item>
<first>storemerge_i_reg_123</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>87</item>
</second>
</item>
<item>
<first>tdest_54_i_reg_155</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>79</item>
</second>
</item>
<item>
<first>tdest_5_ph_i_reg_134</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>75</item>
</second>
</item>
<item>
<first>tmp_11_reg_343</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>tmp_1_reg_339</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>tmp_reg_348</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>50</item>
</second>
</item>
</dp_regname_nodes>
<dp_reg_phi>
<count>3</count>
<item_version>0</item_version>
<item>
<first>123</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>87</item>
</second>
</item>
<item>
<first>134</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>75</item>
</second>
</item>
<item>
<first>155</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>79</item>
</second>
</item>
</dp_reg_phi>
<dp_regname_phi>
<count>3</count>
<item_version>0</item_version>
<item>
<first>storemerge_i_reg_123</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>87</item>
</second>
</item>
<item>
<first>tdest_54_i_reg_155</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>79</item>
</second>
</item>
<item>
<first>tdest_5_ph_i_reg_134</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>75</item>
</second>
</item>
</dp_regname_phi>
<dp_port_io_nodes class_id="56" tracking_level="0" version="0">
<count>6</count>
<item_version>0</item_version>
<item class_id="57" tracking_level="0" version="0">
<first>eth_level_pkt</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>write</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>82</item>
<item>40</item>
</second>
</item>
</second>
</item>
<item>
<first>s_axis_V_data_V</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>nbreadreq</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>50</item>
<item>30</item>
<item>18</item>
</second>
</item>
<item>
<first>read</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>53</item>
<item>33</item>
<item>21</item>
</second>
</item>
</second>
</item>
<item>
<first>s_axis_V_dest_V</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>nbreadreq</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>50</item>
<item>30</item>
<item>18</item>
</second>
</item>
<item>
<first>read</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>53</item>
<item>33</item>
<item>21</item>
</second>
</item>
</second>
</item>
<item>
<first>s_axis_V_keep_V</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>nbreadreq</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>50</item>
<item>30</item>
<item>18</item>
</second>
</item>
<item>
<first>read</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>53</item>
<item>33</item>
<item>21</item>
</second>
</item>
</second>
</item>
<item>
<first>s_axis_V_last_V</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>nbreadreq</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>50</item>
<item>30</item>
<item>18</item>
</second>
</item>
<item>
<first>read</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>53</item>
<item>33</item>
<item>21</item>
</second>
</item>
</second>
</item>
<item>
<first>s_axis_V_strb_V</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>nbreadreq</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>50</item>
<item>30</item>
<item>18</item>
</second>
</item>
<item>
<first>read</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>53</item>
<item>33</item>
<item>21</item>
</second>
</item>
</second>
</item>
</dp_port_io_nodes>
<port2core>
<count>1</count>
<item_version>0</item_version>
<item>
<first>8</first>
<second>
<first>1151</first>
<second>7</second>
</second>
</item>
</port2core>
<node2core>
<count>11</count>
<item_version>0</item_version>
<item>
<first>18</first>
<second>
<first>888</first>
<second>111</second>
</second>
</item>
<item>
<first>21</first>
<second>
<first>888</first>
<second>111</second>
</second>
</item>
<item>
<first>30</first>
<second>
<first>888</first>
<second>111</second>
</second>
</item>
<item>
<first>33</first>
<second>
<first>888</first>
<second>111</second>
</second>
</item>
<item>
<first>40</first>
<second>
<first>1151</first>
<second>7</second>
</second>
</item>
<item>
<first>50</first>
<second>
<first>888</first>
<second>111</second>
</second>
</item>
<item>
<first>53</first>
<second>
<first>888</first>
<second>111</second>
</second>
</item>
<item>
<first>64</first>
<second>
<first>45</first>
<second>0</second>
</second>
</item>
<item>
<first>71</first>
<second>
<first>45</first>
<second>0</second>
</second>
</item>
<item>
<first>82</first>
<second>
<first>1151</first>
<second>7</second>
</second>
</item>
<item>
<first>88</first>
<second>
<first>49</first>
<second>107</second>
</second>
</item>
</node2core>
</syndb>
</boost_serialization>
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015-2016, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with STM32.Device;
with Ada.Real_Time; use Ada.Real_Time;
with STM32_SVD.I2C; use STM32_SVD.I2C;
with HAL.I2C; use HAL.I2C;
package body STM32.I2C is
type I2C_Transfer_Mode is
(Reload_Mode, -- Enable reload mode
Autoend_Mode, -- Enable automatic end mode
Softend_Mode); -- Enable software end mode
type I2C_Request is
(No_Start_Stop, -- Don't generate start or stop
Generate_Stop, -- Generate a stop condition
Generate_Start_Read, -- Generate a start read request
Generate_Start_Write); -- Generate a start write request
procedure Config_Transfer
(Port : in out I2C_Port;
Addr : I2C_Address;
Size : UInt8;
Mode : I2C_Transfer_Mode;
Request : I2C_Request);
procedure Reset_Config (Port : in out I2C_Port);
procedure Check_Nack
(Port : in out I2C_Port;
Timeout : Natural;
Status : out HAL.I2C.I2C_Status);
procedure Wait_Tx_Interrupt_Status
(Port : in out I2C_Port;
Timeout : Natural;
Status : out I2C_Status);
procedure Wait_Transfer_Complete_Reset_Flag
(Port : in out I2C_Port;
Timeout : Natural;
Status : out I2C_Status);
procedure Wait_Stop_Flag
(Port : in out I2C_Port;
Timeout : Natural;
Status : out I2C_Status);
------------------
-- Port_Enabled --
------------------
function Port_Enabled (This : I2C_Port) return Boolean
is
begin
return This.Periph.CR1.PE;
end Port_Enabled;
---------------
-- Configure --
---------------
procedure Configure
(This : in out I2C_Port;
Configuration : I2C_Configuration)
is
begin
if This.State /= Reset then
return;
end if;
This.Config := Configuration;
-- Disable the I2C port
This.Periph.CR1.PE := False;
-- Reset the timing register to 100_000 Hz
This.Periph.TIMINGR :=
(SCLL => 50,
SCLH => 39,
SDADEL => 1,
SCLDEL => 9,
PRESC => 4,
others => <>);
-- I2C Own Address Register configuration
This.Periph.OAR1.OA1EN := False;
if Configuration.Own_Address /= 0 then
This.Periph.OAR1 :=
(OA1 => Configuration.Own_Address,
OA1EN => True,
OA1MODE => Configuration.Addressing_Mode = Addressing_Mode_10bit,
others => <>);
end if;
-- CR2 configuration
-- Enable AUTOEND by default, set NACK (should be disabled only in
-- slave mode
This.Periph.CR2.ADD10 :=
Configuration.Addressing_Mode = Addressing_Mode_10bit;
This.Periph.CR2.AUTOEND := True;
This.Periph.CR2.NACK := True;
-- OAR2 configuration
-- ??? Add support for dual addressing
This.Periph.OAR2 := (others => <>);
-- CR1 configuration
This.Periph.CR1 :=
(GCEN => Configuration.General_Call_Enabled,
NOSTRETCH => False,
others => <>);
This.State := Ready;
-- Enable the port
This.Periph.CR1.PE := True;
end Configure;
-------------------
-- Is_Configured --
-------------------
function Is_Configured (Port : I2C_Port) return Boolean
is
begin
return Port.State /= Reset;
end Is_Configured;
----------------------
-- Setup_I2C_Master --
----------------------
procedure Setup_I2C_Master (Port : in out I2C_Port'Class;
SDA, SCL : GPIO_Point;
SDA_AF, SCL_AF : GPIO_Alternate_Function;
Clock_Speed : UInt32)
is
use STM32.Device;
I2C_Conf : I2C_Configuration;
begin
if Port_Enabled (Port) then
return;
end if;
-- GPIO --
Enable_Clock (SDA & SCL);
Configure_IO (SDA,
(Mode => Mode_AF,
AF => SDA_AF,
AF_Speed => Speed_High,
AF_Output_Type => Open_Drain,
Resistors => Floating));
Configure_IO (SCL,
(Mode => Mode_AF,
AF => SCL_AF,
AF_Speed => Speed_High,
AF_Output_Type => Open_Drain,
Resistors => Floating));
Lock (SDA & SCL);
-- I2C --
Enable_Clock (Port);
delay until Clock + Milliseconds (200);
Reset (Port);
I2C_Conf.Own_Address := 16#00#;
I2C_Conf.Addressing_Mode := Addressing_Mode_7bit;
I2C_Conf.General_Call_Enabled := False;
I2C_Conf.Clock_Stretching_Enabled := True;
I2C_Conf.Clock_Speed := Clock_Speed;
I2C_Conf.Enable_DMA := True;
Port.Configure (I2C_Conf);
end Setup_I2C_Master;
---------------------
-- Config_Transfer --
---------------------
procedure Config_Transfer
(Port : in out I2C_Port;
Addr : I2C_Address;
Size : UInt8;
Mode : I2C_Transfer_Mode;
Request : I2C_Request)
is
CR2 : CR2_Register := Port.Periph.CR2;
begin
CR2.SADD := Addr;
CR2.NBYTES := Size;
CR2.RELOAD := Mode = Reload_Mode;
CR2.AUTOEND := Mode = Autoend_Mode;
CR2.RD_WRN := False;
CR2.START := False;
CR2.STOP := False;
case Request is
when No_Start_Stop =>
null;
when Generate_Stop =>
CR2.STOP := True;
when Generate_Start_Read =>
CR2.RD_WRN := True;
CR2.START := True;
when Generate_Start_Write =>
CR2.START := True;
end case;
Port.Periph.CR2 := CR2;
end Config_Transfer;
------------------
-- Reset_Config --
------------------
procedure Reset_Config (Port : in out I2C_Port)
is
CR2 : CR2_Register := Port.Periph.CR2;
begin
CR2.SADD := 0;
CR2.HEAD10R := False;
CR2.NBYTES := 0;
CR2.RELOAD := False;
CR2.RD_WRN := False;
Port.Periph.CR2 := CR2;
end Reset_Config;
-----------------
-- Flag_Status --
-----------------
function Flag_Status
(This : I2C_Port; Flag : I2C_Status_Flag) return Boolean
is
begin
case Flag is
when Tx_Data_Register_Empty =>
return This.Periph.ISR.TXE;
when Tx_Data_Register_Empty_Interrupt =>
return This.Periph.ISR.TXIS;
when Rx_Data_Register_Not_Empty =>
return This.Periph.ISR.RXNE;
when Address_Matched =>
return This.Periph.ISR.ADDR;
when Ack_Failure =>
return This.Periph.ISR.NACKF;
when Stop_Detection =>
return This.Periph.ISR.STOPF;
when Transfer_Complete =>
return This.Periph.ISR.TC;
when Transfer_Complete_Reload =>
return This.Periph.ISR.TCR;
when Bus_Error =>
return This.Periph.ISR.BERR;
when Arbitration_Lost =>
return This.Periph.ISR.ARLO;
when UnderOverrun =>
return This.Periph.ISR.OVR;
when Packet_Error =>
return This.Periph.ISR.PECERR;
when Timeout =>
return This.Periph.ISR.TIMEOUT;
when SMB_Alert =>
return This.Periph.ISR.ALERT;
when Bus_Busy =>
return This.Periph.ISR.BUSY;
when Transmitter_Receiver_Mode =>
return This.Periph.ISR.DIR;
end case;
end Flag_Status;
----------------
-- Clear_Flag --
----------------
procedure Clear_Flag
(This : in out I2C_Port;
Target : Clearable_I2C_Status_Flag)
is
begin
case Target is
when Address_Matched =>
This.Periph.ICR.ADDRCF := True;
when Ack_Failure =>
This.Periph.ICR.NACKCF := True;
when Stop_Detection =>
This.Periph.ICR.STOPCF := True;
when Bus_Error =>
This.Periph.ICR.BERRCF := True;
when Arbitration_Lost =>
This.Periph.ICR.ARLOCF := True;
when UnderOverrun =>
This.Periph.ICR.OVRCF := True;
when Packet_Error =>
This.Periph.ICR.PECCF := True;
when Timeout =>
This.Periph.ICR.TIMOUTCF := True;
when SMB_Alert =>
This.Periph.ICR.ALERTCF := True;
end case;
end Clear_Flag;
-------------------------
-- Tx_Data_Register_Flush --
-------------------------
procedure Tx_Data_Register_Flush (This : in out I2C_Port) is
begin
This.Periph.ISR.TXE := True;
end Tx_Data_Register_Flush;
--------------------------------
-- Tx_Data_Register_Gen_Event --
--------------------------------
procedure Tx_Data_Register_Gen_Event (This : in out I2C_Port) is
begin
if This.Periph.CR1.NOSTRETCH = True then
This.Periph.ISR.TXIS := True;
end if;
end Tx_Data_Register_Gen_Event;
---------------------
-- Wait_While_Flag --
---------------------
procedure Wait_While_Flag
(This : in out I2C_Port;
Flag : I2C_Status_Flag;
F_State : Boolean;
Timeout : Natural;
Status : out HAL.I2C.I2C_Status)
is
Deadline : constant Time := Clock + Milliseconds (Timeout);
begin
while Flag_Status (This, Flag) = F_State loop
if Clock > Deadline then
This.State := Ready;
Status := HAL.I2C.Err_Timeout;
return;
end if;
end loop;
Status := HAL.I2C.Ok;
end Wait_While_Flag;
----------------
-- Check_Nack --
----------------
procedure Check_Nack
(Port : in out I2C_Port;
Timeout : Natural;
Status : out I2C_Status)
is
Start : constant Time := Clock;
begin
if Port.Periph.ISR.NACKF then
if Port.State = Master_Busy_Tx
or else Port.State = Mem_Busy_Tx
or else Port.State = Mem_Busy_Rx
then
-- We generate a STOP condition if SOFTEND mode is enabled
if not Port.Periph.CR2.AUTOEND then
Port.Periph.CR2.STOP := True;
end if;
end if;
while not Port.Periph.ISR.STOPF loop
if Timeout > 0
and then Start + Milliseconds (Timeout) < Clock
then
Port.State := Ready;
Status := Err_Timeout;
return;
end if;
end loop;
-- Clear the MACL amd STOP flags
Port.Periph.ICR.NACKCF := True;
Port.Periph.ICR.STOPCF := True;
-- Clear CR2
Reset_Config (Port);
Port.State := Ready;
Status := Err_Error;
else
Status := Ok;
end if;
end Check_Nack;
------------------------------
-- Wait_Tx_Interrupt_Status --
------------------------------
procedure Wait_Tx_Interrupt_Status
(Port : in out I2C_Port;
Timeout : Natural;
Status : out I2C_Status)
is
Start : constant Time := Clock;
begin
while not Port.Periph.ISR.TXIS loop
Check_Nack (Port, Timeout, Status);
if Status /= Ok then
Port.State := Ready;
Status := Err_Error;
return;
end if;
if Timeout > 0
and then Start + Milliseconds (Timeout) < Clock
then
Reset_Config (Port);
Port.State := Ready;
Status := Err_Timeout;
return;
end if;
end loop;
Status := Ok;
end Wait_Tx_Interrupt_Status;
---------------------------------------
-- Wait_Transfer_Complete_Reset_Flag --
---------------------------------------
procedure Wait_Transfer_Complete_Reset_Flag
(Port : in out I2C_Port;
Timeout : Natural;
Status : out I2C_Status)
is
Start : constant Time := Clock;
begin
while not Port.Periph.ISR.TCR loop
if Timeout > 0
and then Start + Milliseconds (Timeout) < Clock
then
Reset_Config (Port);
Status := Err_Timeout;
Port.State := Ready;
return;
end if;
end loop;
Status := Ok;
end Wait_Transfer_Complete_Reset_Flag;
--------------------
-- Wait_Stop_Flag --
--------------------
procedure Wait_Stop_Flag
(Port : in out I2C_Port;
Timeout : Natural;
Status : out I2C_Status)
is
Start : constant Time := Clock;
begin
while not Port.Periph.ISR.STOPF loop
Check_Nack (Port, Timeout, Status);
if Status /= Ok then
Port.State := Ready;
Status := Err_Error;
return;
end if;
if Timeout > 0
and then Start + Milliseconds (Timeout) < Clock
then
Reset_Config (Port);
Status := Err_Timeout;
Port.State := Ready;
return;
end if;
end loop;
-- Clear the stop flag
Port.Periph.ICR.STOPCF := True;
Status := Ok;
end Wait_Stop_Flag;
---------------------
-- Master_Transmit --
---------------------
overriding
procedure Master_Transmit
(This : in out I2C_Port;
Addr : I2C_Address;
Data : I2C_Data;
Status : out I2C_Status;
Timeout : Natural := 1000)
is
Size_Temp : Natural := 0;
Transmitted : Natural := 0;
begin
if This.Periph.ISR.BUSY then
Status := Busy;
return;
end if;
if Data'Length = 0 then
Status := Err_Error;
return;
end if;
if This.State /= Ready then
Status := Busy;
return;
end if;
This.State := Master_Busy_Tx;
-- Initiate the transfer
if Data'Length > 255 then
Config_Transfer
(This, Addr, 255, Reload_Mode, Generate_Start_Write);
Size_Temp := 255;
else
Config_Transfer
(This, Addr, Data'Length, Autoend_Mode, Generate_Start_Write);
Size_Temp := Data'Length;
end if;
-- Transfer the data
while Transmitted < Data'Length loop
Wait_Tx_Interrupt_Status (This, Timeout, Status);
if Status /= Ok then
return;
end if;
This.Periph.TXDR.TXDATA := Data (Data'First + Transmitted);
Transmitted := Transmitted + 1;
if Transmitted = Size_Temp
and then Transmitted < Data'Length
then
-- Wait for the Transfer complete reload flag
Wait_Transfer_Complete_Reset_Flag (This, Timeout, Status);
if Status /= Ok then
return;
end if;
if Data'Length - Transmitted > 255 then
Config_Transfer
(This, Addr, 255, Reload_Mode, No_Start_Stop);
Size_Temp := 255;
else
Config_Transfer
(This, Addr, UInt8 (Data'Length - Transmitted), Autoend_Mode,
No_Start_Stop);
Size_Temp := Data'Length - Transmitted;
end if;
end if;
end loop;
Wait_Stop_Flag (This, Timeout, Status);
if Status /= Ok then
return;
end if;
-- Reset CR2
Reset_Config (This);
This.State := Ready;
Status := Ok;
end Master_Transmit;
--------------------
-- Master_Receive --
--------------------
overriding
procedure Master_Receive
(This : in out I2C_Port;
Addr : I2C_Address;
Data : out I2C_Data;
Status : out I2C_Status;
Timeout : Natural := 1000)
is
Size_Temp : Natural := 0;
Transmitted : Natural := 0;
begin
if This.Periph.ISR.BUSY then
Status := Busy;
return;
end if;
if This.State /= Ready then
Status := Busy;
return;
end if;
This.State := Master_Busy_Rx;
if Data'Length = 0 then
Status := Err_Error;
return;
end if;
-- Initiate the transfer
if Data'Length > 255 then
Config_Transfer
(This, Addr, 255, Reload_Mode, Generate_Start_Read);
Size_Temp := 255;
else
Config_Transfer
(This, Addr, Data'Length, Autoend_Mode, Generate_Start_Read);
Size_Temp := Data'Length;
end if;
-- Transfer the data
while Transmitted < Data'Length loop
while not This.Periph.ISR.RXNE loop
null;
end loop;
Data (Data'First + Transmitted) := This.Periph.RXDR.RXDATA;
Transmitted := Transmitted + 1;
Size_Temp := Size_Temp - 1;
if Size_Temp = 0
and then Transmitted < Data'Length
then
-- Wait for the Transfer complete reload flag
while This.Periph.ISR.TCR loop
null;
end loop;
if Data'Length - Transmitted > 255 then
Config_Transfer
(This, Addr, 255, Reload_Mode, No_Start_Stop);
Size_Temp := 255;
else
Config_Transfer
(This, Addr, UInt8 (Data'Length - Transmitted), Autoend_Mode,
No_Start_Stop);
Size_Temp := Data'Length - Transmitted;
end if;
end if;
end loop;
Wait_Stop_Flag (This, Timeout, Status);
if Status /= Ok then
return;
end if;
-- Reset CR2
Reset_Config (This);
This.State := Ready;
Status := Ok;
end Master_Receive;
---------------
-- Mem_Write --
---------------
overriding
procedure Mem_Write
(This : in out I2C_Port;
Addr : I2C_Address;
Mem_Addr : UInt16;
Mem_Addr_Size : I2C_Memory_Address_Size;
Data : I2C_Data;
Status : out I2C_Status;
Timeout : Natural := 1000)
is
Size_Temp : Natural := 0;
Transmitted : Natural := 0;
Start : Time;
begin
Start := Clock;
while This.Periph.ISR.BUSY loop
if Clock - Start > Milliseconds (Timeout) then
Status := Busy;
return;
end if;
end loop;
if Data'Length = 0 then
Status := Err_Error;
return;
end if;
if This.State /= Ready then
Status := Busy;
return;
end if;
This.State := Mem_Busy_Tx;
-- Configure the memory transfer
Config_Transfer
(This,
Addr,
(case Mem_Addr_Size is
when Memory_Size_8b => 1,
when Memory_Size_16b => 2),
Reload_Mode,
Generate_Start_Write);
Wait_Tx_Interrupt_Status (This, Timeout, Status);
if Status /= Ok then
This.State := Ready;
return;
end if;
case Mem_Addr_Size is
when Memory_Size_8b =>
This.Periph.TXDR.TXDATA := UInt8 (Mem_Addr);
when Memory_Size_16b =>
declare
MSB : constant UInt8 := UInt8 (Shift_Right (Mem_Addr, 8));
LSB : constant UInt8 := UInt8 (Mem_Addr and 16#FF#);
begin
This.Periph.TXDR.TXDATA := MSB;
Wait_Tx_Interrupt_Status (This, Timeout, Status);
if Status /= Ok then
return;
end if;
This.Periph.TXDR.TXDATA := LSB;
end;
end case;
Wait_Transfer_Complete_Reset_Flag (This, Timeout, Status);
if Status /= Ok then
return;
end if;
-- Initiate the transfer
if Data'Length > 255 then
Config_Transfer
(This, Addr, 255, Reload_Mode, No_Start_Stop);
Size_Temp := 255;
else
Config_Transfer
(This, Addr, Data'Length, Autoend_Mode, No_Start_Stop);
Size_Temp := Data'Length;
end if;
-- Transfer the data
while Transmitted < Data'Length loop
Wait_Tx_Interrupt_Status (This, Timeout, Status);
if Status /= Ok then
return;
end if;
This.Periph.TXDR.TXDATA := Data (Data'First + Transmitted);
Transmitted := Transmitted + 1;
if Transmitted = Size_Temp
and then Transmitted < Data'Length
then
-- Wait for the Transfer complete reload flag
Wait_Transfer_Complete_Reset_Flag (This, Timeout, Status);
if Status /= Ok then
return;
end if;
if Data'Length - Transmitted > 255 then
Config_Transfer
(This, Addr, 255, Reload_Mode, No_Start_Stop);
Size_Temp := 255;
else
Config_Transfer
(This, Addr,
UInt8 (Data'Length - Transmitted),
Autoend_Mode,
No_Start_Stop);
Size_Temp := Data'Length - Transmitted;
end if;
end if;
end loop;
Wait_Stop_Flag (This, Timeout, Status);
if Status /= Ok then
return;
end if;
-- Reset CR2
Reset_Config (This);
This.State := Ready;
Status := Ok;
end Mem_Write;
--------------
-- Mem_Read --
--------------
overriding
procedure Mem_Read
(This : in out I2C_Port;
Addr : I2C_Address;
Mem_Addr : UInt16;
Mem_Addr_Size : I2C_Memory_Address_Size;
Data : out I2C_Data;
Status : out I2C_Status;
Timeout : Natural := 1000)
is
Size_Temp : Natural := 0;
Transmitted : Natural := 0;
Start : Time;
begin
Start := Clock;
while This.Periph.ISR.BUSY loop
if Clock - Start > Milliseconds (Timeout) then
Status := Busy;
return;
end if;
end loop;
if Data'Length = 0 then
Status := Err_Error;
return;
end if;
if This.State /= Ready then
Status := Busy;
return;
end if;
This.State := Mem_Busy_Rx;
-- Configure the memory transfer
Config_Transfer
(This,
Addr,
(case Mem_Addr_Size is
when Memory_Size_8b => 1,
when Memory_Size_16b => 2),
Softend_Mode,
Generate_Start_Write);
Wait_Tx_Interrupt_Status (This, Timeout, Status);
if Status /= Ok then
return;
end if;
case Mem_Addr_Size is
when Memory_Size_8b =>
This.Periph.TXDR.TXDATA := UInt8 (Mem_Addr);
when Memory_Size_16b =>
declare
MSB : constant UInt8 := UInt8 (Shift_Right (Mem_Addr, 8));
LSB : constant UInt8 := UInt8 (Mem_Addr and 16#FF#);
begin
This.Periph.TXDR.TXDATA := MSB;
Wait_Tx_Interrupt_Status (This, Timeout, Status);
if Status /= Ok then
return;
end if;
This.Periph.TXDR.TXDATA := LSB;
end;
end case;
-- Wait for transfer complete
while not This.Periph.ISR.TC loop
null;
end loop;
-- Initiate the transfer
if Data'Length > 255 then
Config_Transfer
(This, Addr, 255, Reload_Mode, Generate_Start_Read);
Size_Temp := 255;
else
Config_Transfer
(This, Addr, Data'Length, Autoend_Mode, Generate_Start_Read);
Size_Temp := Data'Length;
end if;
-- Transfer the data
while Transmitted < Data'Length loop
while not This.Periph.ISR.RXNE loop
null;
end loop;
Data (Data'First + Transmitted) := This.Periph.RXDR.RXDATA;
Transmitted := Transmitted + 1;
Size_Temp := Size_Temp - 1;
if Size_Temp = 0
and then Transmitted < Data'Length
then
-- Wait for the Transfer complete reload flag
while not This.Periph.ISR.TCR loop
null;
end loop;
if Data'Length - Transmitted > 255 then
Config_Transfer
(This, Addr, 255, Reload_Mode, No_Start_Stop);
Size_Temp := 255;
else
Config_Transfer
(This, Addr,
UInt8 (Data'Length - Transmitted),
Autoend_Mode,
No_Start_Stop);
Size_Temp := Data'Length - Transmitted;
end if;
end if;
end loop;
Wait_Stop_Flag (This, Timeout, Status);
if Status /= Ok then
return;
end if;
-- Reset CR2
Reset_Config (This);
This.State := Ready;
Status := Ok;
end Mem_Read;
end STM32.I2C;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S E M _ T Y P E --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Atree; use Atree;
with Alloc;
with Debug; use Debug;
with Einfo; use Einfo;
with Elists; use Elists;
with Nlists; use Nlists;
with Errout; use Errout;
with Lib; use Lib;
with Namet; use Namet;
with Opt; use Opt;
with Output; use Output;
with Sem; use Sem;
with Sem_Aux; use Sem_Aux;
with Sem_Ch6; use Sem_Ch6;
with Sem_Ch8; use Sem_Ch8;
with Sem_Ch12; use Sem_Ch12;
with Sem_Disp; use Sem_Disp;
with Sem_Dist; use Sem_Dist;
with Sem_Util; use Sem_Util;
with Stand; use Stand;
with Sinfo; use Sinfo;
with Snames; use Snames;
with Table;
with Treepr; use Treepr;
with Uintp; use Uintp;
package body Sem_Type is
---------------------
-- Data Structures --
---------------------
-- The following data structures establish a mapping between nodes and
-- their interpretations. An overloaded node has an entry in Interp_Map,
-- which in turn contains a pointer into the All_Interp array. The
-- interpretations of a given node are contiguous in All_Interp. Each set
-- of interpretations is terminated with the marker No_Interp. In order to
-- speed up the retrieval of the interpretations of an overloaded node, the
-- Interp_Map table is accessed by means of a simple hashing scheme, and
-- the entries in Interp_Map are chained. The heads of clash lists are
-- stored in array Headers.
-- Headers Interp_Map All_Interp
-- _ +-----+ +--------+
-- |_| |_____| --->|interp1 |
-- |_|---------->|node | | |interp2 |
-- |_| |index|---------| |nointerp|
-- |_| |next | | |
-- |-----| | |
-- +-----+ +--------+
-- This scheme does not currently reclaim interpretations. In principle,
-- after a unit is compiled, all overloadings have been resolved, and the
-- candidate interpretations should be deleted. This should be easier
-- now than with the previous scheme???
package All_Interp is new Table.Table (
Table_Component_Type => Interp,
Table_Index_Type => Interp_Index,
Table_Low_Bound => 0,
Table_Initial => Alloc.All_Interp_Initial,
Table_Increment => Alloc.All_Interp_Increment,
Table_Name => "All_Interp");
type Interp_Ref is record
Node : Node_Id;
Index : Interp_Index;
Next : Int;
end record;
Header_Size : constant Int := 2 ** 12;
No_Entry : constant Int := -1;
Headers : array (0 .. Header_Size) of Int := (others => No_Entry);
package Interp_Map is new Table.Table (
Table_Component_Type => Interp_Ref,
Table_Index_Type => Int,
Table_Low_Bound => 0,
Table_Initial => Alloc.Interp_Map_Initial,
Table_Increment => Alloc.Interp_Map_Increment,
Table_Name => "Interp_Map");
function Hash (N : Node_Id) return Int;
-- A trivial hashing function for nodes, used to insert an overloaded
-- node into the Interp_Map table.
-------------------------------------
-- Handling of Overload Resolution --
-------------------------------------
-- Overload resolution uses two passes over the syntax tree of a complete
-- context. In the first, bottom-up pass, the types of actuals in calls
-- are used to resolve possibly overloaded subprogram and operator names.
-- In the second top-down pass, the type of the context (for example the
-- condition in a while statement) is used to resolve a possibly ambiguous
-- call, and the unique subprogram name in turn imposes a specific context
-- on each of its actuals.
-- Most expressions are in fact unambiguous, and the bottom-up pass is
-- sufficient to resolve most everything. To simplify the common case,
-- names and expressions carry a flag Is_Overloaded to indicate whether
-- they have more than one interpretation. If the flag is off, then each
-- name has already a unique meaning and type, and the bottom-up pass is
-- sufficient (and much simpler).
--------------------------
-- Operator Overloading --
--------------------------
-- The visibility of operators is handled differently from that of other
-- entities. We do not introduce explicit versions of primitive operators
-- for each type definition. As a result, there is only one entity
-- corresponding to predefined addition on all numeric types, etc. The
-- back end resolves predefined operators according to their type. The
-- visibility of primitive operations then reduces to the visibility of the
-- resulting type: (a + b) is a legal interpretation of some primitive
-- operator + if the type of the result (which must also be the type of a
-- and b) is directly visible (either immediately visible or use-visible).
-- User-defined operators are treated like other functions, but the
-- visibility of these user-defined operations must be special-cased
-- to determine whether they hide or are hidden by predefined operators.
-- The form P."+" (x, y) requires additional handling.
-- Concatenation is treated more conventionally: for every one-dimensional
-- array type we introduce a explicit concatenation operator. This is
-- necessary to handle the case of (element & element => array) which
-- cannot be handled conveniently if there is no explicit instance of
-- resulting type of the operation.
-----------------------
-- Local Subprograms --
-----------------------
procedure All_Overloads;
pragma Warnings (Off, All_Overloads);
-- Debugging procedure: list full contents of Overloads table
function Binary_Op_Interp_Has_Abstract_Op
(N : Node_Id;
E : Entity_Id) return Entity_Id;
-- Given the node and entity of a binary operator, determine whether the
-- actuals of E contain an abstract interpretation with regards to the
-- types of their corresponding formals. Return the abstract operation or
-- Empty.
function Function_Interp_Has_Abstract_Op
(N : Node_Id;
E : Entity_Id) return Entity_Id;
-- Given the node and entity of a function call, determine whether the
-- actuals of E contain an abstract interpretation with regards to the
-- types of their corresponding formals. Return the abstract operation or
-- Empty.
function Has_Abstract_Op
(N : Node_Id;
Typ : Entity_Id) return Entity_Id;
-- Subsidiary routine to Binary_Op_Interp_Has_Abstract_Op and Function_
-- Interp_Has_Abstract_Op. Determine whether an overloaded node has an
-- abstract interpretation which yields type Typ.
procedure New_Interps (N : Node_Id);
-- Initialize collection of interpretations for the given node, which is
-- either an overloaded entity, or an operation whose arguments have
-- multiple interpretations. Interpretations can be added to only one
-- node at a time.
function Specific_Type (Typ_1, Typ_2 : Entity_Id) return Entity_Id;
-- If Typ_1 and Typ_2 are compatible, return the one that is not universal
-- or is not a "class" type (any_character, etc).
--------------------
-- Add_One_Interp --
--------------------
procedure Add_One_Interp
(N : Node_Id;
E : Entity_Id;
T : Entity_Id;
Opnd_Type : Entity_Id := Empty)
is
Vis_Type : Entity_Id;
procedure Add_Entry (Name : Entity_Id; Typ : Entity_Id);
-- Add one interpretation to an overloaded node. Add a new entry if
-- not hidden by previous one, and remove previous one if hidden by
-- new one.
function Is_Universal_Operation (Op : Entity_Id) return Boolean;
-- True if the entity is a predefined operator and the operands have
-- a universal Interpretation.
---------------
-- Add_Entry --
---------------
procedure Add_Entry (Name : Entity_Id; Typ : Entity_Id) is
Abstr_Op : Entity_Id := Empty;
I : Interp_Index;
It : Interp;
-- Start of processing for Add_Entry
begin
-- Find out whether the new entry references interpretations that
-- are abstract or disabled by abstract operators.
if Ada_Version >= Ada_2005 then
if Nkind (N) in N_Binary_Op then
Abstr_Op := Binary_Op_Interp_Has_Abstract_Op (N, Name);
elsif Nkind (N) = N_Function_Call then
Abstr_Op := Function_Interp_Has_Abstract_Op (N, Name);
end if;
end if;
Get_First_Interp (N, I, It);
while Present (It.Nam) loop
-- A user-defined subprogram hides another declared at an outer
-- level, or one that is use-visible. So return if previous
-- definition hides new one (which is either in an outer
-- scope, or use-visible). Note that for functions use-visible
-- is the same as potentially use-visible. If new one hides
-- previous one, replace entry in table of interpretations.
-- If this is a universal operation, retain the operator in case
-- preference rule applies.
if (((Ekind (Name) = E_Function or else Ekind (Name) = E_Procedure)
and then Ekind (Name) = Ekind (It.Nam))
or else (Ekind (Name) = E_Operator
and then Ekind (It.Nam) = E_Function))
and then Is_Immediately_Visible (It.Nam)
and then Type_Conformant (Name, It.Nam)
and then Base_Type (It.Typ) = Base_Type (T)
then
if Is_Universal_Operation (Name) then
exit;
-- If node is an operator symbol, we have no actuals with
-- which to check hiding, and this is done in full in the
-- caller (Analyze_Subprogram_Renaming) so we include the
-- predefined operator in any case.
elsif Nkind (N) = N_Operator_Symbol
or else
(Nkind (N) = N_Expanded_Name
and then Nkind (Selector_Name (N)) = N_Operator_Symbol)
then
exit;
elsif not In_Open_Scopes (Scope (Name))
or else Scope_Depth (Scope (Name)) <=
Scope_Depth (Scope (It.Nam))
then
-- If ambiguity within instance, and entity is not an
-- implicit operation, save for later disambiguation.
if Scope (Name) = Scope (It.Nam)
and then not Is_Inherited_Operation (Name)
and then In_Instance
then
exit;
else
return;
end if;
else
All_Interp.Table (I).Nam := Name;
return;
end if;
-- Avoid making duplicate entries in overloads
elsif Name = It.Nam
and then Base_Type (It.Typ) = Base_Type (T)
then
return;
-- Otherwise keep going
else
Get_Next_Interp (I, It);
end if;
end loop;
All_Interp.Table (All_Interp.Last) := (Name, Typ, Abstr_Op);
All_Interp.Append (No_Interp);
end Add_Entry;
----------------------------
-- Is_Universal_Operation --
----------------------------
function Is_Universal_Operation (Op : Entity_Id) return Boolean is
Arg : Node_Id;
begin
if Ekind (Op) /= E_Operator then
return False;
elsif Nkind (N) in N_Binary_Op then
return Present (Universal_Interpretation (Left_Opnd (N)))
and then Present (Universal_Interpretation (Right_Opnd (N)));
elsif Nkind (N) in N_Unary_Op then
return Present (Universal_Interpretation (Right_Opnd (N)));
elsif Nkind (N) = N_Function_Call then
Arg := First_Actual (N);
while Present (Arg) loop
if No (Universal_Interpretation (Arg)) then
return False;
end if;
Next_Actual (Arg);
end loop;
return True;
else
return False;
end if;
end Is_Universal_Operation;
-- Start of processing for Add_One_Interp
begin
-- If the interpretation is a predefined operator, verify that the
-- result type is visible, or that the entity has already been
-- resolved (case of an instantiation node that refers to a predefined
-- operation, or an internally generated operator node, or an operator
-- given as an expanded name). If the operator is a comparison or
-- equality, it is the type of the operand that matters to determine
-- whether the operator is visible. In an instance, the check is not
-- performed, given that the operator was visible in the generic.
if Ekind (E) = E_Operator then
if Present (Opnd_Type) then
Vis_Type := Opnd_Type;
else
Vis_Type := Base_Type (T);
end if;
if In_Open_Scopes (Scope (Vis_Type))
or else Is_Potentially_Use_Visible (Vis_Type)
or else In_Use (Vis_Type)
or else (In_Use (Scope (Vis_Type))
and then not Is_Hidden (Vis_Type))
or else Nkind (N) = N_Expanded_Name
or else (Nkind (N) in N_Op and then E = Entity (N))
or else In_Instance
or else Ekind (Vis_Type) = E_Anonymous_Access_Type
then
null;
-- If the node is given in functional notation and the prefix
-- is an expanded name, then the operator is visible if the
-- prefix is the scope of the result type as well. If the
-- operator is (implicitly) defined in an extension of system,
-- it is know to be valid (see Defined_In_Scope, sem_ch4.adb).
elsif Nkind (N) = N_Function_Call
and then Nkind (Name (N)) = N_Expanded_Name
and then (Entity (Prefix (Name (N))) = Scope (Base_Type (T))
or else Entity (Prefix (Name (N))) = Scope (Vis_Type)
or else Scope (Vis_Type) = System_Aux_Id)
then
null;
-- Save type for subsequent error message, in case no other
-- interpretation is found.
else
Candidate_Type := Vis_Type;
return;
end if;
-- In an instance, an abstract non-dispatching operation cannot be a
-- candidate interpretation, because it could not have been one in the
-- generic (it may be a spurious overloading in the instance).
elsif In_Instance
and then Is_Overloadable (E)
and then Is_Abstract_Subprogram (E)
and then not Is_Dispatching_Operation (E)
then
return;
-- An inherited interface operation that is implemented by some derived
-- type does not participate in overload resolution, only the
-- implementation operation does.
elsif Is_Hidden (E)
and then Is_Subprogram (E)
and then Present (Interface_Alias (E))
then
-- Ada 2005 (AI-251): If this primitive operation corresponds with
-- an immediate ancestor interface there is no need to add it to the
-- list of interpretations. The corresponding aliased primitive is
-- also in this list of primitive operations and will be used instead
-- because otherwise we have a dummy ambiguity between the two
-- subprograms which are in fact the same.
if not Is_Ancestor
(Find_Dispatching_Type (Interface_Alias (E)),
Find_Dispatching_Type (E))
then
Add_One_Interp (N, Interface_Alias (E), T);
end if;
return;
-- Calling stubs for an RACW operation never participate in resolution,
-- they are executed only through dispatching calls.
elsif Is_RACW_Stub_Type_Operation (E) then
return;
end if;
-- If this is the first interpretation of N, N has type Any_Type.
-- In that case place the new type on the node. If one interpretation
-- already exists, indicate that the node is overloaded, and store
-- both the previous and the new interpretation in All_Interp. If
-- this is a later interpretation, just add it to the set.
if Etype (N) = Any_Type then
if Is_Type (E) then
Set_Etype (N, T);
else
-- Record both the operator or subprogram name, and its type
if Nkind (N) in N_Op or else Is_Entity_Name (N) then
Set_Entity (N, E);
end if;
Set_Etype (N, T);
end if;
-- Either there is no current interpretation in the table for any
-- node or the interpretation that is present is for a different
-- node. In both cases add a new interpretation to the table.
elsif Interp_Map.Last < 0
or else
(Interp_Map.Table (Interp_Map.Last).Node /= N
and then not Is_Overloaded (N))
then
New_Interps (N);
if (Nkind (N) in N_Op or else Is_Entity_Name (N))
and then Present (Entity (N))
then
Add_Entry (Entity (N), Etype (N));
elsif Nkind (N) in N_Subprogram_Call
and then Is_Entity_Name (Name (N))
then
Add_Entry (Entity (Name (N)), Etype (N));
-- If this is an indirect call there will be no name associated
-- with the previous entry. To make diagnostics clearer, save
-- Subprogram_Type of first interpretation, so that the error will
-- point to the anonymous access to subprogram, not to the result
-- type of the call itself.
elsif (Nkind (N)) = N_Function_Call
and then Nkind (Name (N)) = N_Explicit_Dereference
and then Is_Overloaded (Name (N))
then
declare
It : Interp;
Itn : Interp_Index;
pragma Warnings (Off, Itn);
begin
Get_First_Interp (Name (N), Itn, It);
Add_Entry (It.Nam, Etype (N));
end;
else
-- Overloaded prefix in indexed or selected component, or call
-- whose name is an expression or another call.
Add_Entry (Etype (N), Etype (N));
end if;
Add_Entry (E, T);
else
Add_Entry (E, T);
end if;
end Add_One_Interp;
-------------------
-- All_Overloads --
-------------------
procedure All_Overloads is
begin
for J in All_Interp.First .. All_Interp.Last loop
if Present (All_Interp.Table (J).Nam) then
Write_Entity_Info (All_Interp.Table (J). Nam, " ");
else
Write_Str ("No Interp");
Write_Eol;
end if;
Write_Str ("=================");
Write_Eol;
end loop;
end All_Overloads;
--------------------------------------
-- Binary_Op_Interp_Has_Abstract_Op --
--------------------------------------
function Binary_Op_Interp_Has_Abstract_Op
(N : Node_Id;
E : Entity_Id) return Entity_Id
is
Abstr_Op : Entity_Id;
E_Left : constant Node_Id := First_Formal (E);
E_Right : constant Node_Id := Next_Formal (E_Left);
begin
Abstr_Op := Has_Abstract_Op (Left_Opnd (N), Etype (E_Left));
if Present (Abstr_Op) then
return Abstr_Op;
end if;
return Has_Abstract_Op (Right_Opnd (N), Etype (E_Right));
end Binary_Op_Interp_Has_Abstract_Op;
---------------------
-- Collect_Interps --
---------------------
procedure Collect_Interps (N : Node_Id) is
Ent : constant Entity_Id := Entity (N);
H : Entity_Id;
First_Interp : Interp_Index;
function Within_Instance (E : Entity_Id) return Boolean;
-- Within an instance there can be spurious ambiguities between a local
-- entity and one declared outside of the instance. This can only happen
-- for subprograms, because otherwise the local entity hides the outer
-- one. For an overloadable entity, this predicate determines whether it
-- is a candidate within the instance, or must be ignored.
---------------------
-- Within_Instance --
---------------------
function Within_Instance (E : Entity_Id) return Boolean is
Inst : Entity_Id;
Scop : Entity_Id;
begin
if not In_Instance then
return False;
end if;
Inst := Current_Scope;
while Present (Inst) and then not Is_Generic_Instance (Inst) loop
Inst := Scope (Inst);
end loop;
Scop := Scope (E);
while Present (Scop) and then Scop /= Standard_Standard loop
if Scop = Inst then
return True;
end if;
Scop := Scope (Scop);
end loop;
return False;
end Within_Instance;
-- Start of processing for Collect_Interps
begin
New_Interps (N);
-- Unconditionally add the entity that was initially matched
First_Interp := All_Interp.Last;
Add_One_Interp (N, Ent, Etype (N));
-- For expanded name, pick up all additional entities from the
-- same scope, since these are obviously also visible. Note that
-- these are not necessarily contiguous on the homonym chain.
if Nkind (N) = N_Expanded_Name then
H := Homonym (Ent);
while Present (H) loop
if Scope (H) = Scope (Entity (N)) then
Add_One_Interp (N, H, Etype (H));
end if;
H := Homonym (H);
end loop;
-- Case of direct name
else
-- First, search the homonym chain for directly visible entities
H := Current_Entity (Ent);
while Present (H) loop
exit when
not Is_Overloadable (H)
and then Is_Immediately_Visible (H);
if Is_Immediately_Visible (H) and then H /= Ent then
-- Only add interpretation if not hidden by an inner
-- immediately visible one.
for J in First_Interp .. All_Interp.Last - 1 loop
-- Current homograph is not hidden. Add to overloads
if not Is_Immediately_Visible (All_Interp.Table (J).Nam) then
exit;
-- Homograph is hidden, unless it is a predefined operator
elsif Type_Conformant (H, All_Interp.Table (J).Nam) then
-- A homograph in the same scope can occur within an
-- instantiation, the resulting ambiguity has to be
-- resolved later. The homographs may both be local
-- functions or actuals, or may be declared at different
-- levels within the instance. The renaming of an actual
-- within the instance must not be included.
if Within_Instance (H)
and then H /= Renamed_Entity (Ent)
and then not Is_Inherited_Operation (H)
then
All_Interp.Table (All_Interp.Last) :=
(H, Etype (H), Empty);
All_Interp.Append (No_Interp);
goto Next_Homograph;
elsif Scope (H) /= Standard_Standard then
goto Next_Homograph;
end if;
end if;
end loop;
-- On exit, we know that current homograph is not hidden
Add_One_Interp (N, H, Etype (H));
if Debug_Flag_E then
Write_Str ("Add overloaded interpretation ");
Write_Int (Int (H));
Write_Eol;
end if;
end if;
<<Next_Homograph>>
H := Homonym (H);
end loop;
-- Scan list of homographs for use-visible entities only
H := Current_Entity (Ent);
while Present (H) loop
if Is_Potentially_Use_Visible (H)
and then H /= Ent
and then Is_Overloadable (H)
then
for J in First_Interp .. All_Interp.Last - 1 loop
if not Is_Immediately_Visible (All_Interp.Table (J).Nam) then
exit;
elsif Type_Conformant (H, All_Interp.Table (J).Nam) then
goto Next_Use_Homograph;
end if;
end loop;
Add_One_Interp (N, H, Etype (H));
end if;
<<Next_Use_Homograph>>
H := Homonym (H);
end loop;
end if;
if All_Interp.Last = First_Interp + 1 then
-- The final interpretation is in fact not overloaded. Note that the
-- unique legal interpretation may or may not be the original one,
-- so we need to update N's entity and etype now, because once N
-- is marked as not overloaded it is also expected to carry the
-- proper interpretation.
Set_Is_Overloaded (N, False);
Set_Entity (N, All_Interp.Table (First_Interp).Nam);
Set_Etype (N, All_Interp.Table (First_Interp).Typ);
end if;
end Collect_Interps;
------------
-- Covers --
------------
function Covers (T1, T2 : Entity_Id) return Boolean is
BT1 : Entity_Id;
BT2 : Entity_Id;
function Full_View_Covers (Typ1, Typ2 : Entity_Id) return Boolean;
-- In an instance the proper view may not always be correct for
-- private types, but private and full view are compatible. This
-- removes spurious errors from nested instantiations that involve,
-- among other things, types derived from private types.
function Real_Actual (T : Entity_Id) return Entity_Id;
-- If an actual in an inner instance is the formal of an enclosing
-- generic, the actual in the enclosing instance is the one that can
-- create an accidental ambiguity, and the check on compatibily of
-- generic actual types must use this enclosing actual.
----------------------
-- Full_View_Covers --
----------------------
function Full_View_Covers (Typ1, Typ2 : Entity_Id) return Boolean is
begin
return
Is_Private_Type (Typ1)
and then
((Present (Full_View (Typ1))
and then Covers (Full_View (Typ1), Typ2))
or else (Present (Underlying_Full_View (Typ1))
and then Covers (Underlying_Full_View (Typ1), Typ2))
or else Base_Type (Typ1) = Typ2
or else Base_Type (Typ2) = Typ1);
end Full_View_Covers;
-----------------
-- Real_Actual --
-----------------
function Real_Actual (T : Entity_Id) return Entity_Id is
Par : constant Node_Id := Parent (T);
RA : Entity_Id;
begin
-- Retrieve parent subtype from subtype declaration for actual
if Nkind (Par) = N_Subtype_Declaration
and then not Comes_From_Source (Par)
and then Is_Entity_Name (Subtype_Indication (Par))
then
RA := Entity (Subtype_Indication (Par));
if Is_Generic_Actual_Type (RA) then
return RA;
end if;
end if;
-- Otherwise actual is not the actual of an enclosing instance
return T;
end Real_Actual;
-- Start of processing for Covers
begin
-- If either operand missing, then this is an error, but ignore it (and
-- pretend we have a cover) if errors already detected, since this may
-- simply mean we have malformed trees or a semantic error upstream.
if No (T1) or else No (T2) then
if Total_Errors_Detected /= 0 then
return True;
else
raise Program_Error;
end if;
end if;
-- Trivial case: same types are always compatible
if T1 = T2 then
return True;
end if;
-- First check for Standard_Void_Type, which is special. Subsequent
-- processing in this routine assumes T1 and T2 are bona fide types;
-- Standard_Void_Type is a special entity that has some, but not all,
-- properties of types.
if (T1 = Standard_Void_Type) /= (T2 = Standard_Void_Type) then
return False;
end if;
BT1 := Base_Type (T1);
BT2 := Base_Type (T2);
-- Handle underlying view of records with unknown discriminants
-- using the original entity that motivated the construction of
-- this underlying record view (see Build_Derived_Private_Type).
if Is_Underlying_Record_View (BT1) then
BT1 := Underlying_Record_View (BT1);
end if;
if Is_Underlying_Record_View (BT2) then
BT2 := Underlying_Record_View (BT2);
end if;
-- Simplest case: types that have the same base type and are not generic
-- actuals are compatible. Generic actuals belong to their class but are
-- not compatible with other types of their class, and in particular
-- with other generic actuals. They are however compatible with their
-- own subtypes, and itypes with the same base are compatible as well.
-- Similarly, constrained subtypes obtained from expressions of an
-- unconstrained nominal type are compatible with the base type (may
-- lead to spurious ambiguities in obscure cases ???)
-- Generic actuals require special treatment to avoid spurious ambi-
-- guities in an instance, when two formal types are instantiated with
-- the same actual, so that different subprograms end up with the same
-- signature in the instance. If a generic actual is the actual of an
-- enclosing instance, it is that actual that we must compare: generic
-- actuals are only incompatible if they appear in the same instance.
if BT1 = BT2
or else BT1 = T2
or else BT2 = T1
then
if not Is_Generic_Actual_Type (T1)
or else
not Is_Generic_Actual_Type (T2)
then
return True;
-- Both T1 and T2 are generic actual types
else
declare
RT1 : constant Entity_Id := Real_Actual (T1);
RT2 : constant Entity_Id := Real_Actual (T2);
begin
return RT1 = RT2
or else Is_Itype (T1)
or else Is_Itype (T2)
or else Is_Constr_Subt_For_U_Nominal (T1)
or else Is_Constr_Subt_For_U_Nominal (T2)
or else Scope (RT1) /= Scope (RT2);
end;
end if;
-- Literals are compatible with types in a given "class"
elsif (T2 = Universal_Integer and then Is_Integer_Type (T1))
or else (T2 = Universal_Real and then Is_Real_Type (T1))
or else (T2 = Universal_Fixed and then Is_Fixed_Point_Type (T1))
or else (T2 = Any_Fixed and then Is_Fixed_Point_Type (T1))
or else (T2 = Any_String and then Is_String_Type (T1))
or else (T2 = Any_Character and then Is_Character_Type (T1))
or else (T2 = Any_Access and then Is_Access_Type (T1))
then
return True;
-- The context may be class wide, and a class-wide type is compatible
-- with any member of the class.
elsif Is_Class_Wide_Type (T1)
and then Is_Ancestor (Root_Type (T1), T2)
then
return True;
elsif Is_Class_Wide_Type (T1)
and then Is_Class_Wide_Type (T2)
and then Base_Type (Etype (T1)) = Base_Type (Etype (T2))
then
return True;
-- Ada 2005 (AI-345): A class-wide abstract interface type covers a
-- task_type or protected_type that implements the interface.
elsif Ada_Version >= Ada_2005
and then Is_Class_Wide_Type (T1)
and then Is_Interface (Etype (T1))
and then Is_Concurrent_Type (T2)
and then Interface_Present_In_Ancestor
(Typ => BT2, Iface => Etype (T1))
then
return True;
-- Ada 2005 (AI-251): A class-wide abstract interface type T1 covers an
-- object T2 implementing T1.
elsif Ada_Version >= Ada_2005
and then Is_Class_Wide_Type (T1)
and then Is_Interface (Etype (T1))
and then Is_Tagged_Type (T2)
then
if Interface_Present_In_Ancestor (Typ => T2,
Iface => Etype (T1))
then
return True;
end if;
declare
E : Entity_Id;
Elmt : Elmt_Id;
begin
if Is_Concurrent_Type (BT2) then
E := Corresponding_Record_Type (BT2);
else
E := BT2;
end if;
-- Ada 2005 (AI-251): A class-wide abstract interface type T1
-- covers an object T2 that implements a direct derivation of T1.
-- Note: test for presence of E is defense against previous error.
if No (E) then
-- If expansion is disabled the Corresponding_Record_Type may
-- not be available yet, so use the interface list in the
-- declaration directly.
if ASIS_Mode
and then Nkind (Parent (BT2)) = N_Protected_Type_Declaration
and then Present (Interface_List (Parent (BT2)))
then
declare
Intf : Node_Id := First (Interface_List (Parent (BT2)));
begin
while Present (Intf) loop
if Is_Ancestor (Etype (T1), Entity (Intf)) then
return True;
else
Next (Intf);
end if;
end loop;
end;
return False;
else
Check_Error_Detected;
end if;
-- Here we have a corresponding record type
elsif Present (Interfaces (E)) then
Elmt := First_Elmt (Interfaces (E));
while Present (Elmt) loop
if Is_Ancestor (Etype (T1), Node (Elmt)) then
return True;
else
Next_Elmt (Elmt);
end if;
end loop;
end if;
-- We should also check the case in which T1 is an ancestor of
-- some implemented interface???
return False;
end;
-- In a dispatching call, the formal is of some specific type, and the
-- actual is of the corresponding class-wide type, including a subtype
-- of the class-wide type.
elsif Is_Class_Wide_Type (T2)
and then
(Class_Wide_Type (T1) = Class_Wide_Type (T2)
or else Base_Type (Root_Type (T2)) = BT1)
then
return True;
-- Some contexts require a class of types rather than a specific type.
-- For example, conditions require any boolean type, fixed point
-- attributes require some real type, etc. The built-in types Any_XXX
-- represent these classes.
elsif (T1 = Any_Integer and then Is_Integer_Type (T2))
or else (T1 = Any_Boolean and then Is_Boolean_Type (T2))
or else (T1 = Any_Real and then Is_Real_Type (T2))
or else (T1 = Any_Fixed and then Is_Fixed_Point_Type (T2))
or else (T1 = Any_Discrete and then Is_Discrete_Type (T2))
then
return True;
-- An aggregate is compatible with an array or record type
elsif T2 = Any_Composite and then Is_Aggregate_Type (T1) then
return True;
-- If the expected type is an anonymous access, the designated type must
-- cover that of the expression. Use the base type for this check: even
-- though access subtypes are rare in sources, they are generated for
-- actuals in instantiations.
elsif Ekind (BT1) = E_Anonymous_Access_Type
and then Is_Access_Type (T2)
and then Covers (Designated_Type (T1), Designated_Type (T2))
then
return True;
-- Ada 2012 (AI05-0149): Allow an anonymous access type in the context
-- of a named general access type. An implicit conversion will be
-- applied. For the resolution, one designated type must cover the
-- other.
elsif Ada_Version >= Ada_2012
and then Ekind (BT1) = E_General_Access_Type
and then Ekind (BT2) = E_Anonymous_Access_Type
and then (Covers (Designated_Type (T1), Designated_Type (T2))
or else
Covers (Designated_Type (T2), Designated_Type (T1)))
then
return True;
-- An Access_To_Subprogram is compatible with itself, or with an
-- anonymous type created for an attribute reference Access.
elsif Ekind_In (BT1, E_Access_Subprogram_Type,
E_Access_Protected_Subprogram_Type)
and then Is_Access_Type (T2)
and then (not Comes_From_Source (T1)
or else not Comes_From_Source (T2))
and then (Is_Overloadable (Designated_Type (T2))
or else Ekind (Designated_Type (T2)) = E_Subprogram_Type)
and then Type_Conformant (Designated_Type (T1), Designated_Type (T2))
and then Mode_Conformant (Designated_Type (T1), Designated_Type (T2))
then
return True;
-- Ada 2005 (AI-254): An Anonymous_Access_To_Subprogram is compatible
-- with itself, or with an anonymous type created for an attribute
-- reference Access.
elsif Ekind_In (BT1, E_Anonymous_Access_Subprogram_Type,
E_Anonymous_Access_Protected_Subprogram_Type)
and then Is_Access_Type (T2)
and then (not Comes_From_Source (T1)
or else not Comes_From_Source (T2))
and then (Is_Overloadable (Designated_Type (T2))
or else Ekind (Designated_Type (T2)) = E_Subprogram_Type)
and then Type_Conformant (Designated_Type (T1), Designated_Type (T2))
and then Mode_Conformant (Designated_Type (T1), Designated_Type (T2))
then
return True;
-- The context can be a remote access type, and the expression the
-- corresponding source type declared in a categorized package, or
-- vice versa.
elsif Is_Record_Type (T1)
and then (Is_Remote_Call_Interface (T1) or else Is_Remote_Types (T1))
and then Present (Corresponding_Remote_Type (T1))
then
return Covers (Corresponding_Remote_Type (T1), T2);
-- and conversely.
elsif Is_Record_Type (T2)
and then (Is_Remote_Call_Interface (T2) or else Is_Remote_Types (T2))
and then Present (Corresponding_Remote_Type (T2))
then
return Covers (Corresponding_Remote_Type (T2), T1);
-- Synchronized types are represented at run time by their corresponding
-- record type. During expansion one is replaced with the other, but
-- they are compatible views of the same type.
elsif Is_Record_Type (T1)
and then Is_Concurrent_Type (T2)
and then Present (Corresponding_Record_Type (T2))
then
return Covers (T1, Corresponding_Record_Type (T2));
elsif Is_Concurrent_Type (T1)
and then Present (Corresponding_Record_Type (T1))
and then Is_Record_Type (T2)
then
return Covers (Corresponding_Record_Type (T1), T2);
-- During analysis, an attribute reference 'Access has a special type
-- kind: Access_Attribute_Type, to be replaced eventually with the type
-- imposed by context.
elsif Ekind (T2) = E_Access_Attribute_Type
and then Ekind_In (BT1, E_General_Access_Type, E_Access_Type)
and then Covers (Designated_Type (T1), Designated_Type (T2))
then
-- If the target type is a RACW type while the source is an access
-- attribute type, we are building a RACW that may be exported.
if Is_Remote_Access_To_Class_Wide_Type (BT1) then
Set_Has_RACW (Current_Sem_Unit);
end if;
return True;
-- Ditto for allocators, which eventually resolve to the context type
elsif Ekind (T2) = E_Allocator_Type and then Is_Access_Type (T1) then
return Covers (Designated_Type (T1), Designated_Type (T2))
or else
(From_Limited_With (Designated_Type (T1))
and then Covers (Designated_Type (T2), Designated_Type (T1)));
-- A boolean operation on integer literals is compatible with modular
-- context.
elsif T2 = Any_Modular and then Is_Modular_Integer_Type (T1) then
return True;
-- The actual type may be the result of a previous error
elsif BT2 = Any_Type then
return True;
-- A Raise_Expressions is legal in any expression context
elsif BT2 = Raise_Type then
return True;
-- A packed array type covers its corresponding non-packed type. This is
-- not legitimate Ada, but allows the omission of a number of otherwise
-- useless unchecked conversions, and since this can only arise in
-- (known correct) expanded code, no harm is done.
elsif Is_Array_Type (T2)
and then Is_Packed (T2)
and then T1 = Packed_Array_Impl_Type (T2)
then
return True;
-- Similarly an array type covers its corresponding packed array type
elsif Is_Array_Type (T1)
and then Is_Packed (T1)
and then T2 = Packed_Array_Impl_Type (T1)
then
return True;
-- In instances, or with types exported from instantiations, check
-- whether a partial and a full view match. Verify that types are
-- legal, to prevent cascaded errors.
elsif In_Instance
and then (Full_View_Covers (T1, T2) or else Full_View_Covers (T2, T1))
then
return True;
elsif Is_Type (T2)
and then Is_Generic_Actual_Type (T2)
and then Full_View_Covers (T1, T2)
then
return True;
elsif Is_Type (T1)
and then Is_Generic_Actual_Type (T1)
and then Full_View_Covers (T2, T1)
then
return True;
-- In the expansion of inlined bodies, types are compatible if they
-- are structurally equivalent.
elsif In_Inlined_Body
and then (Underlying_Type (T1) = Underlying_Type (T2)
or else
(Is_Access_Type (T1)
and then Is_Access_Type (T2)
and then Designated_Type (T1) = Designated_Type (T2))
or else
(T1 = Any_Access
and then Is_Access_Type (Underlying_Type (T2)))
or else
(T2 = Any_Composite
and then Is_Composite_Type (Underlying_Type (T1))))
then
return True;
-- Ada 2005 (AI-50217): Additional branches to make the shadow entity
-- obtained through a limited_with compatible with its real entity.
elsif From_Limited_With (T1) then
-- If the expected type is the nonlimited view of a type, the
-- expression may have the limited view. If that one in turn is
-- incomplete, get full view if available.
return Has_Non_Limited_View (T1)
and then Covers (Get_Full_View (Non_Limited_View (T1)), T2);
elsif From_Limited_With (T2) then
-- If units in the context have Limited_With clauses on each other,
-- either type might have a limited view. Checks performed elsewhere
-- verify that the context type is the nonlimited view.
return Has_Non_Limited_View (T2)
and then Covers (T1, Get_Full_View (Non_Limited_View (T2)));
-- Ada 2005 (AI-412): Coverage for regular incomplete subtypes
elsif Ekind (T1) = E_Incomplete_Subtype then
return Covers (Full_View (Etype (T1)), T2);
elsif Ekind (T2) = E_Incomplete_Subtype then
return Covers (T1, Full_View (Etype (T2)));
-- Ada 2005 (AI-423): Coverage of formal anonymous access types
-- and actual anonymous access types in the context of generic
-- instantiations. We have the following situation:
-- generic
-- type Formal is private;
-- Formal_Obj : access Formal; -- T1
-- package G is ...
-- package P is
-- type Actual is ...
-- Actual_Obj : access Actual; -- T2
-- package Instance is new G (Formal => Actual,
-- Formal_Obj => Actual_Obj);
elsif Ada_Version >= Ada_2005
and then Ekind (T1) = E_Anonymous_Access_Type
and then Ekind (T2) = E_Anonymous_Access_Type
and then Is_Generic_Type (Directly_Designated_Type (T1))
and then Get_Instance_Of (Directly_Designated_Type (T1)) =
Directly_Designated_Type (T2)
then
return True;
-- Otherwise, types are not compatible
else
return False;
end if;
end Covers;
------------------
-- Disambiguate --
------------------
function Disambiguate
(N : Node_Id;
I1, I2 : Interp_Index;
Typ : Entity_Id) return Interp
is
I : Interp_Index;
It : Interp;
It1, It2 : Interp;
Nam1, Nam2 : Entity_Id;
Predef_Subp : Entity_Id;
User_Subp : Entity_Id;
function Inherited_From_Actual (S : Entity_Id) return Boolean;
-- Determine whether one of the candidates is an operation inherited by
-- a type that is derived from an actual in an instantiation.
function In_Same_Declaration_List
(Typ : Entity_Id;
Op_Decl : Entity_Id) return Boolean;
-- AI05-0020: a spurious ambiguity may arise when equality on anonymous
-- access types is declared on the partial view of a designated type, so
-- that the type declaration and equality are not in the same list of
-- declarations. This AI gives a preference rule for the user-defined
-- operation. Same rule applies for arithmetic operations on private
-- types completed with fixed-point types: the predefined operation is
-- hidden; this is already handled properly in GNAT.
function Is_Actual_Subprogram (S : Entity_Id) return Boolean;
-- Determine whether a subprogram is an actual in an enclosing instance.
-- An overloading between such a subprogram and one declared outside the
-- instance is resolved in favor of the first, because it resolved in
-- the generic. Within the instance the actual is represented by a
-- constructed subprogram renaming.
function Matches (Op : Node_Id; Func_Id : Entity_Id) return Boolean;
-- Determine whether function Func_Id is an exact match for binary or
-- unary operator Op.
function Operand_Type return Entity_Id;
-- Determine type of operand for an equality operation, to apply Ada
-- 2005 rules to equality on anonymous access types.
function Standard_Operator return Boolean;
-- Check whether subprogram is predefined operator declared in Standard.
-- It may given by an operator name, or by an expanded name whose prefix
-- is Standard.
function Remove_Conversions return Interp;
-- Last chance for pathological cases involving comparisons on literals,
-- and user overloadings of the same operator. Such pathologies have
-- been removed from the ACVC, but still appear in two DEC tests, with
-- the following notable quote from Ben Brosgol:
--
-- [Note: I disclaim all credit/responsibility/blame for coming up with
-- this example; Robert Dewar brought it to our attention, since it is
-- apparently found in the ACVC 1.5. I did not attempt to find the
-- reason in the Reference Manual that makes the example legal, since I
-- was too nauseated by it to want to pursue it further.]
--
-- Accordingly, this is not a fully recursive solution, but it handles
-- DEC tests c460vsa, c460vsb. It also handles ai00136a, which pushes
-- pathology in the other direction with calls whose multiple overloaded
-- actuals make them truly unresolvable.
-- The new rules concerning abstract operations create additional need
-- for special handling of expressions with universal operands, see
-- comments to Has_Abstract_Interpretation below.
---------------------------
-- Inherited_From_Actual --
---------------------------
function Inherited_From_Actual (S : Entity_Id) return Boolean is
Par : constant Node_Id := Parent (S);
begin
if Nkind (Par) /= N_Full_Type_Declaration
or else Nkind (Type_Definition (Par)) /= N_Derived_Type_Definition
then
return False;
else
return Is_Entity_Name (Subtype_Indication (Type_Definition (Par)))
and then
Is_Generic_Actual_Type (
Entity (Subtype_Indication (Type_Definition (Par))));
end if;
end Inherited_From_Actual;
------------------------------
-- In_Same_Declaration_List --
------------------------------
function In_Same_Declaration_List
(Typ : Entity_Id;
Op_Decl : Entity_Id) return Boolean
is
Scop : constant Entity_Id := Scope (Typ);
begin
return In_Same_List (Parent (Typ), Op_Decl)
or else
(Ekind_In (Scop, E_Package, E_Generic_Package)
and then List_Containing (Op_Decl) =
Visible_Declarations (Parent (Scop))
and then List_Containing (Parent (Typ)) =
Private_Declarations (Parent (Scop)));
end In_Same_Declaration_List;
--------------------------
-- Is_Actual_Subprogram --
--------------------------
function Is_Actual_Subprogram (S : Entity_Id) return Boolean is
begin
return In_Open_Scopes (Scope (S))
and then Nkind (Unit_Declaration_Node (S)) =
N_Subprogram_Renaming_Declaration
-- Why the Comes_From_Source test here???
and then not Comes_From_Source (Unit_Declaration_Node (S))
and then
(Is_Generic_Instance (Scope (S))
or else Is_Wrapper_Package (Scope (S)));
end Is_Actual_Subprogram;
-------------
-- Matches --
-------------
function Matches (Op : Node_Id; Func_Id : Entity_Id) return Boolean is
function Matching_Types
(Opnd_Typ : Entity_Id;
Formal_Typ : Entity_Id) return Boolean;
-- Determine whether operand type Opnd_Typ and formal parameter type
-- Formal_Typ are either the same or compatible.
--------------------
-- Matching_Types --
--------------------
function Matching_Types
(Opnd_Typ : Entity_Id;
Formal_Typ : Entity_Id) return Boolean
is
begin
-- A direct match
if Opnd_Typ = Formal_Typ then
return True;
-- Any integer type matches universal integer
elsif Opnd_Typ = Universal_Integer
and then Is_Integer_Type (Formal_Typ)
then
return True;
-- Any floating point type matches universal real
elsif Opnd_Typ = Universal_Real
and then Is_Floating_Point_Type (Formal_Typ)
then
return True;
-- The type of the formal parameter maps a generic actual type to
-- a generic formal type. If the operand type is the type being
-- mapped in an instance, then this is a match.
elsif Is_Generic_Actual_Type (Formal_Typ)
and then Etype (Formal_Typ) = Opnd_Typ
then
return True;
-- ??? There are possibly other cases to consider
else
return False;
end if;
end Matching_Types;
-- Local variables
F1 : constant Entity_Id := First_Formal (Func_Id);
F1_Typ : constant Entity_Id := Etype (F1);
F2 : constant Entity_Id := Next_Formal (F1);
F2_Typ : constant Entity_Id := Etype (F2);
Lop_Typ : constant Entity_Id := Etype (Left_Opnd (Op));
Rop_Typ : constant Entity_Id := Etype (Right_Opnd (Op));
-- Start of processing for Matches
begin
if Lop_Typ = F1_Typ then
return Matching_Types (Rop_Typ, F2_Typ);
elsif Rop_Typ = F2_Typ then
return Matching_Types (Lop_Typ, F1_Typ);
-- Otherwise this is not a good match because each operand-formal
-- pair is compatible only on base-type basis, which is not specific
-- enough.
else
return False;
end if;
end Matches;
------------------
-- Operand_Type --
------------------
function Operand_Type return Entity_Id is
Opnd : Node_Id;
begin
if Nkind (N) = N_Function_Call then
Opnd := First_Actual (N);
else
Opnd := Left_Opnd (N);
end if;
return Etype (Opnd);
end Operand_Type;
------------------------
-- Remove_Conversions --
------------------------
function Remove_Conversions return Interp is
I : Interp_Index;
It : Interp;
It1 : Interp;
F1 : Entity_Id;
Act1 : Node_Id;
Act2 : Node_Id;
function Has_Abstract_Interpretation (N : Node_Id) return Boolean;
-- If an operation has universal operands the universal operation
-- is present among its interpretations. If there is an abstract
-- interpretation for the operator, with a numeric result, this
-- interpretation was already removed in sem_ch4, but the universal
-- one is still visible. We must rescan the list of operators and
-- remove the universal interpretation to resolve the ambiguity.
---------------------------------
-- Has_Abstract_Interpretation --
---------------------------------
function Has_Abstract_Interpretation (N : Node_Id) return Boolean is
E : Entity_Id;
begin
if Nkind (N) not in N_Op
or else Ada_Version < Ada_2005
or else not Is_Overloaded (N)
or else No (Universal_Interpretation (N))
then
return False;
else
E := Get_Name_Entity_Id (Chars (N));
while Present (E) loop
if Is_Overloadable (E)
and then Is_Abstract_Subprogram (E)
and then Is_Numeric_Type (Etype (E))
then
return True;
else
E := Homonym (E);
end if;
end loop;
-- Finally, if an operand of the binary operator is itself
-- an operator, recurse to see whether its own abstract
-- interpretation is responsible for the spurious ambiguity.
if Nkind (N) in N_Binary_Op then
return Has_Abstract_Interpretation (Left_Opnd (N))
or else Has_Abstract_Interpretation (Right_Opnd (N));
elsif Nkind (N) in N_Unary_Op then
return Has_Abstract_Interpretation (Right_Opnd (N));
else
return False;
end if;
end if;
end Has_Abstract_Interpretation;
-- Start of processing for Remove_Conversions
begin
It1 := No_Interp;
Get_First_Interp (N, I, It);
while Present (It.Typ) loop
if not Is_Overloadable (It.Nam) then
return No_Interp;
end if;
F1 := First_Formal (It.Nam);
if No (F1) then
return It1;
else
if Nkind (N) in N_Subprogram_Call then
Act1 := First_Actual (N);
if Present (Act1) then
Act2 := Next_Actual (Act1);
else
Act2 := Empty;
end if;
elsif Nkind (N) in N_Unary_Op then
Act1 := Right_Opnd (N);
Act2 := Empty;
elsif Nkind (N) in N_Binary_Op then
Act1 := Left_Opnd (N);
Act2 := Right_Opnd (N);
-- Use the type of the second formal, so as to include
-- exponentiation, where the exponent may be ambiguous and
-- the result non-universal.
Next_Formal (F1);
else
return It1;
end if;
if Nkind (Act1) in N_Op
and then Is_Overloaded (Act1)
and then
(Nkind (Act1) in N_Unary_Op
or else Nkind_In (Left_Opnd (Act1), N_Integer_Literal,
N_Real_Literal))
and then Nkind_In (Right_Opnd (Act1), N_Integer_Literal,
N_Real_Literal)
and then Has_Compatible_Type (Act1, Standard_Boolean)
and then Etype (F1) = Standard_Boolean
then
-- If the two candidates are the original ones, the
-- ambiguity is real. Otherwise keep the original, further
-- calls to Disambiguate will take care of others in the
-- list of candidates.
if It1 /= No_Interp then
if It = Disambiguate.It1
or else It = Disambiguate.It2
then
if It1 = Disambiguate.It1
or else It1 = Disambiguate.It2
then
return No_Interp;
else
It1 := It;
end if;
end if;
elsif Present (Act2)
and then Nkind (Act2) in N_Op
and then Is_Overloaded (Act2)
and then Nkind_In (Right_Opnd (Act2), N_Integer_Literal,
N_Real_Literal)
and then Has_Compatible_Type (Act2, Standard_Boolean)
then
-- The preference rule on the first actual is not
-- sufficient to disambiguate.
goto Next_Interp;
else
It1 := It;
end if;
elsif Is_Numeric_Type (Etype (F1))
and then Has_Abstract_Interpretation (Act1)
then
-- Current interpretation is not the right one because it
-- expects a numeric operand. Examine all the other ones.
declare
I : Interp_Index;
It : Interp;
begin
Get_First_Interp (N, I, It);
while Present (It.Typ) loop
if
not Is_Numeric_Type (Etype (First_Formal (It.Nam)))
then
if No (Act2)
or else not Has_Abstract_Interpretation (Act2)
or else not
Is_Numeric_Type
(Etype (Next_Formal (First_Formal (It.Nam))))
then
return It;
end if;
end if;
Get_Next_Interp (I, It);
end loop;
return No_Interp;
end;
end if;
end if;
<<Next_Interp>>
Get_Next_Interp (I, It);
end loop;
-- After some error, a formal may have Any_Type and yield a spurious
-- match. To avoid cascaded errors if possible, check for such a
-- formal in either candidate.
if Serious_Errors_Detected > 0 then
declare
Formal : Entity_Id;
begin
Formal := First_Formal (Nam1);
while Present (Formal) loop
if Etype (Formal) = Any_Type then
return Disambiguate.It2;
end if;
Next_Formal (Formal);
end loop;
Formal := First_Formal (Nam2);
while Present (Formal) loop
if Etype (Formal) = Any_Type then
return Disambiguate.It1;
end if;
Next_Formal (Formal);
end loop;
end;
end if;
return It1;
end Remove_Conversions;
-----------------------
-- Standard_Operator --
-----------------------
function Standard_Operator return Boolean is
Nam : Node_Id;
begin
if Nkind (N) in N_Op then
return True;
elsif Nkind (N) = N_Function_Call then
Nam := Name (N);
if Nkind (Nam) /= N_Expanded_Name then
return True;
else
return Entity (Prefix (Nam)) = Standard_Standard;
end if;
else
return False;
end if;
end Standard_Operator;
-- Start of processing for Disambiguate
begin
-- Recover the two legal interpretations
Get_First_Interp (N, I, It);
while I /= I1 loop
Get_Next_Interp (I, It);
end loop;
It1 := It;
Nam1 := It.Nam;
while I /= I2 loop
Get_Next_Interp (I, It);
end loop;
It2 := It;
Nam2 := It.Nam;
-- Check whether one of the entities is an Ada 2005/2012 and we are
-- operating in an earlier mode, in which case we discard the Ada
-- 2005/2012 entity, so that we get proper Ada 95 overload resolution.
if Ada_Version < Ada_2005 then
if Is_Ada_2005_Only (Nam1) or else Is_Ada_2012_Only (Nam1) then
return It2;
elsif Is_Ada_2005_Only (Nam2) or else Is_Ada_2012_Only (Nam1) then
return It1;
end if;
end if;
-- Check whether one of the entities is an Ada 2012 entity and we are
-- operating in Ada 2005 mode, in which case we discard the Ada 2012
-- entity, so that we get proper Ada 2005 overload resolution.
if Ada_Version = Ada_2005 then
if Is_Ada_2012_Only (Nam1) then
return It2;
elsif Is_Ada_2012_Only (Nam2) then
return It1;
end if;
end if;
-- If the context is universal, the predefined operator is preferred.
-- This includes bounds in numeric type declarations, and expressions
-- in type conversions. If no interpretation yields a universal type,
-- then we must check whether the user-defined entity hides the prede-
-- fined one.
if Chars (Nam1) in Any_Operator_Name and then Standard_Operator then
if Typ = Universal_Integer
or else Typ = Universal_Real
or else Typ = Any_Integer
or else Typ = Any_Discrete
or else Typ = Any_Real
or else Typ = Any_Type
then
-- Find an interpretation that yields the universal type, or else
-- a predefined operator that yields a predefined numeric type.
declare
Candidate : Interp := No_Interp;
begin
Get_First_Interp (N, I, It);
while Present (It.Typ) loop
if (It.Typ = Universal_Integer
or else It.Typ = Universal_Real)
and then (Typ = Any_Type or else Covers (Typ, It.Typ))
then
return It;
elsif Is_Numeric_Type (It.Typ)
and then Scope (It.Typ) = Standard_Standard
and then Scope (It.Nam) = Standard_Standard
and then Covers (Typ, It.Typ)
then
Candidate := It;
end if;
Get_Next_Interp (I, It);
end loop;
if Candidate /= No_Interp then
return Candidate;
end if;
end;
elsif Chars (Nam1) /= Name_Op_Not
and then (Typ = Standard_Boolean or else Typ = Any_Boolean)
then
-- Equality or comparison operation. Choose predefined operator if
-- arguments are universal. The node may be an operator, name, or
-- a function call, so unpack arguments accordingly.
declare
Arg1, Arg2 : Node_Id;
begin
if Nkind (N) in N_Op then
Arg1 := Left_Opnd (N);
Arg2 := Right_Opnd (N);
elsif Is_Entity_Name (N) then
Arg1 := First_Entity (Entity (N));
Arg2 := Next_Entity (Arg1);
else
Arg1 := First_Actual (N);
Arg2 := Next_Actual (Arg1);
end if;
if Present (Arg2)
and then Present (Universal_Interpretation (Arg1))
and then Universal_Interpretation (Arg2) =
Universal_Interpretation (Arg1)
then
Get_First_Interp (N, I, It);
while Scope (It.Nam) /= Standard_Standard loop
Get_Next_Interp (I, It);
end loop;
return It;
end if;
end;
end if;
end if;
-- If no universal interpretation, check whether user-defined operator
-- hides predefined one, as well as other special cases. If the node
-- is a range, then one or both bounds are ambiguous. Each will have
-- to be disambiguated w.r.t. the context type. The type of the range
-- itself is imposed by the context, so we can return either legal
-- interpretation.
if Ekind (Nam1) = E_Operator then
Predef_Subp := Nam1;
User_Subp := Nam2;
elsif Ekind (Nam2) = E_Operator then
Predef_Subp := Nam2;
User_Subp := Nam1;
elsif Nkind (N) = N_Range then
return It1;
-- Implement AI05-105: A renaming declaration with an access
-- definition must resolve to an anonymous access type. This
-- is a resolution rule and can be used to disambiguate.
elsif Nkind (Parent (N)) = N_Object_Renaming_Declaration
and then Present (Access_Definition (Parent (N)))
then
if Ekind_In (It1.Typ, E_Anonymous_Access_Type,
E_Anonymous_Access_Subprogram_Type)
then
if Ekind (It2.Typ) = Ekind (It1.Typ) then
-- True ambiguity
return No_Interp;
else
return It1;
end if;
elsif Ekind_In (It2.Typ, E_Anonymous_Access_Type,
E_Anonymous_Access_Subprogram_Type)
then
return It2;
-- No legal interpretation
else
return No_Interp;
end if;
-- If two user defined-subprograms are visible, it is a true ambiguity,
-- unless one of them is an entry and the context is a conditional or
-- timed entry call, or unless we are within an instance and this is
-- results from two formals types with the same actual.
else
if Nkind (N) = N_Procedure_Call_Statement
and then Nkind (Parent (N)) = N_Entry_Call_Alternative
and then N = Entry_Call_Statement (Parent (N))
then
if Ekind (Nam2) = E_Entry then
return It2;
elsif Ekind (Nam1) = E_Entry then
return It1;
else
return No_Interp;
end if;
-- If the ambiguity occurs within an instance, it is due to several
-- formal types with the same actual. Look for an exact match between
-- the types of the formals of the overloadable entities, and the
-- actuals in the call, to recover the unambiguous match in the
-- original generic.
-- The ambiguity can also be due to an overloading between a formal
-- subprogram and a subprogram declared outside the generic. If the
-- node is overloaded, it did not resolve to the global entity in
-- the generic, and we choose the formal subprogram.
-- Finally, the ambiguity can be between an explicit subprogram and
-- one inherited (with different defaults) from an actual. In this
-- case the resolution was to the explicit declaration in the
-- generic, and remains so in the instance.
-- The same sort of disambiguation needed for calls is also required
-- for the name given in a subprogram renaming, and that case is
-- handled here as well. We test Comes_From_Source to exclude this
-- treatment for implicit renamings created for formal subprograms.
elsif In_Instance and then not In_Generic_Actual (N) then
if Nkind (N) in N_Subprogram_Call
or else
(Nkind (N) in N_Has_Entity
and then
Nkind (Parent (N)) = N_Subprogram_Renaming_Declaration
and then Comes_From_Source (Parent (N)))
then
declare
Actual : Node_Id;
Formal : Entity_Id;
Renam : Entity_Id := Empty;
Is_Act1 : constant Boolean := Is_Actual_Subprogram (Nam1);
Is_Act2 : constant Boolean := Is_Actual_Subprogram (Nam2);
begin
if Is_Act1 and then not Is_Act2 then
return It1;
elsif Is_Act2 and then not Is_Act1 then
return It2;
elsif Inherited_From_Actual (Nam1)
and then Comes_From_Source (Nam2)
then
return It2;
elsif Inherited_From_Actual (Nam2)
and then Comes_From_Source (Nam1)
then
return It1;
end if;
-- In the case of a renamed subprogram, pick up the entity
-- of the renaming declaration so we can traverse its
-- formal parameters.
if Nkind (N) in N_Has_Entity then
Renam := Defining_Unit_Name (Specification (Parent (N)));
end if;
if Present (Renam) then
Actual := First_Formal (Renam);
else
Actual := First_Actual (N);
end if;
Formal := First_Formal (Nam1);
while Present (Actual) loop
if Etype (Actual) /= Etype (Formal) then
return It2;
end if;
if Present (Renam) then
Next_Formal (Actual);
else
Next_Actual (Actual);
end if;
Next_Formal (Formal);
end loop;
return It1;
end;
elsif Nkind (N) in N_Binary_Op then
if Matches (N, Nam1) then
return It1;
else
return It2;
end if;
elsif Nkind (N) in N_Unary_Op then
if Etype (Right_Opnd (N)) = Etype (First_Formal (Nam1)) then
return It1;
else
return It2;
end if;
else
return Remove_Conversions;
end if;
else
return Remove_Conversions;
end if;
end if;
-- An implicit concatenation operator on a string type cannot be
-- disambiguated from the predefined concatenation. This can only
-- happen with concatenation of string literals.
if Chars (User_Subp) = Name_Op_Concat
and then Ekind (User_Subp) = E_Operator
and then Is_String_Type (Etype (First_Formal (User_Subp)))
then
return No_Interp;
-- If the user-defined operator is in an open scope, or in the scope
-- of the resulting type, or given by an expanded name that names its
-- scope, it hides the predefined operator for the type. Exponentiation
-- has to be special-cased because the implicit operator does not have
-- a symmetric signature, and may not be hidden by the explicit one.
elsif (Nkind (N) = N_Function_Call
and then Nkind (Name (N)) = N_Expanded_Name
and then (Chars (Predef_Subp) /= Name_Op_Expon
or else Hides_Op (User_Subp, Predef_Subp))
and then Scope (User_Subp) = Entity (Prefix (Name (N))))
or else Hides_Op (User_Subp, Predef_Subp)
then
if It1.Nam = User_Subp then
return It1;
else
return It2;
end if;
-- Otherwise, the predefined operator has precedence, or if the user-
-- defined operation is directly visible we have a true ambiguity.
-- If this is a fixed-point multiplication and division in Ada 83 mode,
-- exclude the universal_fixed operator, which often causes ambiguities
-- in legacy code.
-- Ditto in Ada 2012, where an ambiguity may arise for an operation
-- on a partial view that is completed with a fixed point type. See
-- AI05-0020 and AI05-0209. The ambiguity is resolved in favor of the
-- user-defined type and subprogram, so that a client of the package
-- has the same resolution as the body of the package.
else
if (In_Open_Scopes (Scope (User_Subp))
or else Is_Potentially_Use_Visible (User_Subp))
and then not In_Instance
then
if Is_Fixed_Point_Type (Typ)
and then Nam_In (Chars (Nam1), Name_Op_Multiply, Name_Op_Divide)
and then
(Ada_Version = Ada_83
or else (Ada_Version >= Ada_2012
and then In_Same_Declaration_List
(First_Subtype (Typ),
Unit_Declaration_Node (User_Subp))))
then
if It2.Nam = Predef_Subp then
return It1;
else
return It2;
end if;
-- Ada 2005, AI-420: preference rule for "=" on Universal_Access
-- states that the operator defined in Standard is not available
-- if there is a user-defined equality with the proper signature,
-- declared in the same declarative list as the type. The node
-- may be an operator or a function call.
elsif Nam_In (Chars (Nam1), Name_Op_Eq, Name_Op_Ne)
and then Ada_Version >= Ada_2005
and then Etype (User_Subp) = Standard_Boolean
and then Ekind (Operand_Type) = E_Anonymous_Access_Type
and then
In_Same_Declaration_List
(Designated_Type (Operand_Type),
Unit_Declaration_Node (User_Subp))
then
if It2.Nam = Predef_Subp then
return It1;
else
return It2;
end if;
-- An immediately visible operator hides a use-visible user-
-- defined operation. This disambiguation cannot take place
-- earlier because the visibility of the predefined operator
-- can only be established when operand types are known.
elsif Ekind (User_Subp) = E_Function
and then Ekind (Predef_Subp) = E_Operator
and then Nkind (N) in N_Op
and then not Is_Overloaded (Right_Opnd (N))
and then
Is_Immediately_Visible (Base_Type (Etype (Right_Opnd (N))))
and then Is_Potentially_Use_Visible (User_Subp)
then
if It2.Nam = Predef_Subp then
return It1;
else
return It2;
end if;
else
return No_Interp;
end if;
elsif It1.Nam = Predef_Subp then
return It1;
else
return It2;
end if;
end if;
end Disambiguate;
---------------------
-- End_Interp_List --
---------------------
procedure End_Interp_List is
begin
All_Interp.Table (All_Interp.Last) := No_Interp;
All_Interp.Increment_Last;
end End_Interp_List;
-------------------------
-- Entity_Matches_Spec --
-------------------------
function Entity_Matches_Spec (Old_S, New_S : Entity_Id) return Boolean is
begin
-- Simple case: same entity kinds, type conformance is required. A
-- parameterless function can also rename a literal.
if Ekind (Old_S) = Ekind (New_S)
or else (Ekind (New_S) = E_Function
and then Ekind (Old_S) = E_Enumeration_Literal)
then
return Type_Conformant (New_S, Old_S);
elsif Ekind (New_S) = E_Function and then Ekind (Old_S) = E_Operator then
return Operator_Matches_Spec (Old_S, New_S);
elsif Ekind (New_S) = E_Procedure and then Is_Entry (Old_S) then
return Type_Conformant (New_S, Old_S);
else
return False;
end if;
end Entity_Matches_Spec;
----------------------
-- Find_Unique_Type --
----------------------
function Find_Unique_Type (L : Node_Id; R : Node_Id) return Entity_Id is
T : constant Entity_Id := Etype (L);
I : Interp_Index;
It : Interp;
TR : Entity_Id := Any_Type;
begin
if Is_Overloaded (R) then
Get_First_Interp (R, I, It);
while Present (It.Typ) loop
if Covers (T, It.Typ) or else Covers (It.Typ, T) then
-- If several interpretations are possible and L is universal,
-- apply preference rule.
if TR /= Any_Type then
if (T = Universal_Integer or else T = Universal_Real)
and then It.Typ = T
then
TR := It.Typ;
end if;
else
TR := It.Typ;
end if;
end if;
Get_Next_Interp (I, It);
end loop;
Set_Etype (R, TR);
-- In the non-overloaded case, the Etype of R is already set correctly
else
null;
end if;
-- If one of the operands is Universal_Fixed, the type of the other
-- operand provides the context.
if Etype (R) = Universal_Fixed then
return T;
elsif T = Universal_Fixed then
return Etype (R);
-- Ada 2005 (AI-230): Support the following operators:
-- function "=" (L, R : universal_access) return Boolean;
-- function "/=" (L, R : universal_access) return Boolean;
-- Pool specific access types (E_Access_Type) are not covered by these
-- operators because of the legality rule of 4.5.2(9.2): "The operands
-- of the equality operators for universal_access shall be convertible
-- to one another (see 4.6)". For example, considering the type decla-
-- ration "type P is access Integer" and an anonymous access to Integer,
-- P is convertible to "access Integer" by 4.6 (24.11-24.15), but there
-- is no rule in 4.6 that allows "access Integer" to be converted to P.
elsif Ada_Version >= Ada_2005
and then Ekind_In (Etype (L), E_Anonymous_Access_Type,
E_Anonymous_Access_Subprogram_Type)
and then Is_Access_Type (Etype (R))
and then Ekind (Etype (R)) /= E_Access_Type
then
return Etype (L);
elsif Ada_Version >= Ada_2005
and then Ekind_In (Etype (R), E_Anonymous_Access_Type,
E_Anonymous_Access_Subprogram_Type)
and then Is_Access_Type (Etype (L))
and then Ekind (Etype (L)) /= E_Access_Type
then
return Etype (R);
-- If one operand is a raise_expression, use type of other operand
elsif Nkind (L) = N_Raise_Expression then
return Etype (R);
else
return Specific_Type (T, Etype (R));
end if;
end Find_Unique_Type;
-------------------------------------
-- Function_Interp_Has_Abstract_Op --
-------------------------------------
function Function_Interp_Has_Abstract_Op
(N : Node_Id;
E : Entity_Id) return Entity_Id
is
Abstr_Op : Entity_Id;
Act : Node_Id;
Act_Parm : Node_Id;
Form_Parm : Node_Id;
begin
-- Why is check on E needed below ???
-- In any case this para needs comments ???
if Is_Overloaded (N) and then Is_Overloadable (E) then
Act_Parm := First_Actual (N);
Form_Parm := First_Formal (E);
while Present (Act_Parm) and then Present (Form_Parm) loop
Act := Act_Parm;
if Nkind (Act) = N_Parameter_Association then
Act := Explicit_Actual_Parameter (Act);
end if;
Abstr_Op := Has_Abstract_Op (Act, Etype (Form_Parm));
if Present (Abstr_Op) then
return Abstr_Op;
end if;
Next_Actual (Act_Parm);
Next_Formal (Form_Parm);
end loop;
end if;
return Empty;
end Function_Interp_Has_Abstract_Op;
----------------------
-- Get_First_Interp --
----------------------
procedure Get_First_Interp
(N : Node_Id;
I : out Interp_Index;
It : out Interp)
is
Int_Ind : Interp_Index;
Map_Ptr : Int;
O_N : Node_Id;
begin
-- If a selected component is overloaded because the selector has
-- multiple interpretations, the node is a call to a protected
-- operation or an indirect call. Retrieve the interpretation from
-- the selector name. The selected component may be overloaded as well
-- if the prefix is overloaded. That case is unchanged.
if Nkind (N) = N_Selected_Component
and then Is_Overloaded (Selector_Name (N))
then
O_N := Selector_Name (N);
else
O_N := N;
end if;
Map_Ptr := Headers (Hash (O_N));
while Map_Ptr /= No_Entry loop
if Interp_Map.Table (Map_Ptr).Node = O_N then
Int_Ind := Interp_Map.Table (Map_Ptr).Index;
It := All_Interp.Table (Int_Ind);
I := Int_Ind;
return;
else
Map_Ptr := Interp_Map.Table (Map_Ptr).Next;
end if;
end loop;
-- Procedure should never be called if the node has no interpretations
raise Program_Error;
end Get_First_Interp;
---------------------
-- Get_Next_Interp --
---------------------
procedure Get_Next_Interp (I : in out Interp_Index; It : out Interp) is
begin
I := I + 1;
It := All_Interp.Table (I);
end Get_Next_Interp;
-------------------------
-- Has_Compatible_Type --
-------------------------
function Has_Compatible_Type
(N : Node_Id;
Typ : Entity_Id) return Boolean
is
I : Interp_Index;
It : Interp;
begin
if N = Error then
return False;
end if;
if Nkind (N) = N_Subtype_Indication
or else not Is_Overloaded (N)
then
return
Covers (Typ, Etype (N))
-- Ada 2005 (AI-345): The context may be a synchronized interface.
-- If the type is already frozen use the corresponding_record
-- to check whether it is a proper descendant.
or else
(Is_Record_Type (Typ)
and then Is_Concurrent_Type (Etype (N))
and then Present (Corresponding_Record_Type (Etype (N)))
and then Covers (Typ, Corresponding_Record_Type (Etype (N))))
or else
(Is_Concurrent_Type (Typ)
and then Is_Record_Type (Etype (N))
and then Present (Corresponding_Record_Type (Typ))
and then Covers (Corresponding_Record_Type (Typ), Etype (N)))
or else
(not Is_Tagged_Type (Typ)
and then Ekind (Typ) /= E_Anonymous_Access_Type
and then Covers (Etype (N), Typ));
-- Overloaded case
else
Get_First_Interp (N, I, It);
while Present (It.Typ) loop
if (Covers (Typ, It.Typ)
and then
(Scope (It.Nam) /= Standard_Standard
or else not Is_Invisible_Operator (N, Base_Type (Typ))))
-- Ada 2005 (AI-345)
or else
(Is_Concurrent_Type (It.Typ)
and then Present (Corresponding_Record_Type
(Etype (It.Typ)))
and then Covers (Typ, Corresponding_Record_Type
(Etype (It.Typ))))
or else (not Is_Tagged_Type (Typ)
and then Ekind (Typ) /= E_Anonymous_Access_Type
and then Covers (It.Typ, Typ))
then
return True;
end if;
Get_Next_Interp (I, It);
end loop;
return False;
end if;
end Has_Compatible_Type;
---------------------
-- Has_Abstract_Op --
---------------------
function Has_Abstract_Op
(N : Node_Id;
Typ : Entity_Id) return Entity_Id
is
I : Interp_Index;
It : Interp;
begin
if Is_Overloaded (N) then
Get_First_Interp (N, I, It);
while Present (It.Nam) loop
if Present (It.Abstract_Op)
and then Etype (It.Abstract_Op) = Typ
then
return It.Abstract_Op;
end if;
Get_Next_Interp (I, It);
end loop;
end if;
return Empty;
end Has_Abstract_Op;
----------
-- Hash --
----------
function Hash (N : Node_Id) return Int is
begin
-- Nodes have a size that is power of two, so to select significant
-- bits only we remove the low-order bits.
return ((Int (N) / 2 ** 5) mod Header_Size);
end Hash;
--------------
-- Hides_Op --
--------------
function Hides_Op (F : Entity_Id; Op : Entity_Id) return Boolean is
Btyp : constant Entity_Id := Base_Type (Etype (First_Formal (F)));
begin
return Operator_Matches_Spec (Op, F)
and then (In_Open_Scopes (Scope (F))
or else Scope (F) = Scope (Btyp)
or else (not In_Open_Scopes (Scope (Btyp))
and then not In_Use (Btyp)
and then not In_Use (Scope (Btyp))));
end Hides_Op;
------------------------
-- Init_Interp_Tables --
------------------------
procedure Init_Interp_Tables is
begin
All_Interp.Init;
Interp_Map.Init;
Headers := (others => No_Entry);
end Init_Interp_Tables;
-----------------------------------
-- Interface_Present_In_Ancestor --
-----------------------------------
function Interface_Present_In_Ancestor
(Typ : Entity_Id;
Iface : Entity_Id) return Boolean
is
Target_Typ : Entity_Id;
Iface_Typ : Entity_Id;
function Iface_Present_In_Ancestor (Typ : Entity_Id) return Boolean;
-- Returns True if Typ or some ancestor of Typ implements Iface
-------------------------------
-- Iface_Present_In_Ancestor --
-------------------------------
function Iface_Present_In_Ancestor (Typ : Entity_Id) return Boolean is
E : Entity_Id;
AI : Entity_Id;
Elmt : Elmt_Id;
begin
if Typ = Iface_Typ then
return True;
end if;
-- Handle private types
if Present (Full_View (Typ))
and then not Is_Concurrent_Type (Full_View (Typ))
then
E := Full_View (Typ);
else
E := Typ;
end if;
loop
if Present (Interfaces (E))
and then not Is_Empty_Elmt_List (Interfaces (E))
then
Elmt := First_Elmt (Interfaces (E));
while Present (Elmt) loop
AI := Node (Elmt);
if AI = Iface_Typ or else Is_Ancestor (Iface_Typ, AI) then
return True;
end if;
Next_Elmt (Elmt);
end loop;
end if;
exit when Etype (E) = E
-- Handle private types
or else (Present (Full_View (Etype (E)))
and then Full_View (Etype (E)) = E);
-- Check if the current type is a direct derivation of the
-- interface
if Etype (E) = Iface_Typ then
return True;
end if;
-- Climb to the immediate ancestor handling private types
if Present (Full_View (Etype (E))) then
E := Full_View (Etype (E));
else
E := Etype (E);
end if;
end loop;
return False;
end Iface_Present_In_Ancestor;
-- Start of processing for Interface_Present_In_Ancestor
begin
-- Iface might be a class-wide subtype, so we have to apply Base_Type
if Is_Class_Wide_Type (Iface) then
Iface_Typ := Etype (Base_Type (Iface));
else
Iface_Typ := Iface;
end if;
-- Handle subtypes
Iface_Typ := Base_Type (Iface_Typ);
if Is_Access_Type (Typ) then
Target_Typ := Etype (Directly_Designated_Type (Typ));
else
Target_Typ := Typ;
end if;
if Is_Concurrent_Record_Type (Target_Typ) then
Target_Typ := Corresponding_Concurrent_Type (Target_Typ);
end if;
Target_Typ := Base_Type (Target_Typ);
-- In case of concurrent types we can't use the Corresponding Record_Typ
-- to look for the interface because it is built by the expander (and
-- hence it is not always available). For this reason we traverse the
-- list of interfaces (available in the parent of the concurrent type)
if Is_Concurrent_Type (Target_Typ) then
if Present (Interface_List (Parent (Target_Typ))) then
declare
AI : Node_Id;
begin
AI := First (Interface_List (Parent (Target_Typ)));
-- The progenitor itself may be a subtype of an interface type.
while Present (AI) loop
if Etype (AI) = Iface_Typ
or else Base_Type (Etype (AI)) = Iface_Typ
then
return True;
elsif Present (Interfaces (Etype (AI)))
and then Iface_Present_In_Ancestor (Etype (AI))
then
return True;
end if;
Next (AI);
end loop;
end;
end if;
return False;
end if;
if Is_Class_Wide_Type (Target_Typ) then
Target_Typ := Etype (Target_Typ);
end if;
if Ekind (Target_Typ) = E_Incomplete_Type then
-- We must have either a full view or a nonlimited view of the type
-- to locate the list of ancestors.
if Present (Full_View (Target_Typ)) then
Target_Typ := Full_View (Target_Typ);
else
pragma Assert (Present (Non_Limited_View (Target_Typ)));
Target_Typ := Non_Limited_View (Target_Typ);
end if;
-- Protect the front end against previously detected errors
if Ekind (Target_Typ) = E_Incomplete_Type then
return False;
end if;
end if;
return Iface_Present_In_Ancestor (Target_Typ);
end Interface_Present_In_Ancestor;
---------------------
-- Intersect_Types --
---------------------
function Intersect_Types (L, R : Node_Id) return Entity_Id is
Index : Interp_Index;
It : Interp;
Typ : Entity_Id;
function Check_Right_Argument (T : Entity_Id) return Entity_Id;
-- Find interpretation of right arg that has type compatible with T
--------------------------
-- Check_Right_Argument --
--------------------------
function Check_Right_Argument (T : Entity_Id) return Entity_Id is
Index : Interp_Index;
It : Interp;
T2 : Entity_Id;
begin
if not Is_Overloaded (R) then
return Specific_Type (T, Etype (R));
else
Get_First_Interp (R, Index, It);
loop
T2 := Specific_Type (T, It.Typ);
if T2 /= Any_Type then
return T2;
end if;
Get_Next_Interp (Index, It);
exit when No (It.Typ);
end loop;
return Any_Type;
end if;
end Check_Right_Argument;
-- Start of processing for Intersect_Types
begin
if Etype (L) = Any_Type or else Etype (R) = Any_Type then
return Any_Type;
end if;
if not Is_Overloaded (L) then
Typ := Check_Right_Argument (Etype (L));
else
Typ := Any_Type;
Get_First_Interp (L, Index, It);
while Present (It.Typ) loop
Typ := Check_Right_Argument (It.Typ);
exit when Typ /= Any_Type;
Get_Next_Interp (Index, It);
end loop;
end if;
-- If Typ is Any_Type, it means no compatible pair of types was found
if Typ = Any_Type then
if Nkind (Parent (L)) in N_Op then
Error_Msg_N ("incompatible types for operator", Parent (L));
elsif Nkind (Parent (L)) = N_Range then
Error_Msg_N ("incompatible types given in constraint", Parent (L));
-- Ada 2005 (AI-251): Complete the error notification
elsif Is_Class_Wide_Type (Etype (R))
and then Is_Interface (Etype (Class_Wide_Type (Etype (R))))
then
Error_Msg_NE ("(Ada 2005) does not implement interface }",
L, Etype (Class_Wide_Type (Etype (R))));
-- Specialize message if one operand is a limited view, a priori
-- unrelated to all other types.
elsif From_Limited_With (Etype (R)) then
Error_Msg_NE ("limited view of& not compatible with context",
R, Etype (R));
elsif From_Limited_With (Etype (L)) then
Error_Msg_NE ("limited view of& not compatible with context",
L, Etype (L));
else
Error_Msg_N ("incompatible types", Parent (L));
end if;
end if;
return Typ;
end Intersect_Types;
-----------------------
-- In_Generic_Actual --
-----------------------
function In_Generic_Actual (Exp : Node_Id) return Boolean is
Par : constant Node_Id := Parent (Exp);
begin
if No (Par) then
return False;
elsif Nkind (Par) in N_Declaration then
if Nkind (Par) = N_Object_Declaration then
return Present (Corresponding_Generic_Association (Par));
else
return False;
end if;
elsif Nkind (Par) = N_Object_Renaming_Declaration then
return Present (Corresponding_Generic_Association (Par));
elsif Nkind (Par) in N_Statement_Other_Than_Procedure_Call then
return False;
else
return In_Generic_Actual (Parent (Par));
end if;
end In_Generic_Actual;
-----------------
-- Is_Ancestor --
-----------------
function Is_Ancestor
(T1 : Entity_Id;
T2 : Entity_Id;
Use_Full_View : Boolean := False) return Boolean
is
BT1 : Entity_Id;
BT2 : Entity_Id;
Par : Entity_Id;
begin
BT1 := Base_Type (T1);
BT2 := Base_Type (T2);
-- Handle underlying view of records with unknown discriminants using
-- the original entity that motivated the construction of this
-- underlying record view (see Build_Derived_Private_Type).
if Is_Underlying_Record_View (BT1) then
BT1 := Underlying_Record_View (BT1);
end if;
if Is_Underlying_Record_View (BT2) then
BT2 := Underlying_Record_View (BT2);
end if;
if BT1 = BT2 then
return True;
-- The predicate must look past privacy
elsif Is_Private_Type (T1)
and then Present (Full_View (T1))
and then BT2 = Base_Type (Full_View (T1))
then
return True;
elsif Is_Private_Type (T2)
and then Present (Full_View (T2))
and then BT1 = Base_Type (Full_View (T2))
then
return True;
else
-- Obtain the parent of the base type of T2 (use the full view if
-- allowed).
if Use_Full_View
and then Is_Private_Type (BT2)
and then Present (Full_View (BT2))
then
-- No climbing needed if its full view is the root type
if Full_View (BT2) = Root_Type (Full_View (BT2)) then
return False;
end if;
Par := Etype (Full_View (BT2));
else
Par := Etype (BT2);
end if;
loop
-- If there was a error on the type declaration, do not recurse
if Error_Posted (Par) then
return False;
elsif BT1 = Base_Type (Par)
or else (Is_Private_Type (T1)
and then Present (Full_View (T1))
and then Base_Type (Par) = Base_Type (Full_View (T1)))
then
return True;
elsif Is_Private_Type (Par)
and then Present (Full_View (Par))
and then Full_View (Par) = BT1
then
return True;
-- Root type found
elsif Par = Root_Type (Par) then
return False;
-- Continue climbing
else
-- Use the full-view of private types (if allowed)
if Use_Full_View
and then Is_Private_Type (Par)
and then Present (Full_View (Par))
then
Par := Etype (Full_View (Par));
else
Par := Etype (Par);
end if;
end if;
end loop;
end if;
end Is_Ancestor;
---------------------------
-- Is_Invisible_Operator --
---------------------------
function Is_Invisible_Operator
(N : Node_Id;
T : Entity_Id) return Boolean
is
Orig_Node : constant Node_Id := Original_Node (N);
begin
if Nkind (N) not in N_Op then
return False;
elsif not Comes_From_Source (N) then
return False;
elsif No (Universal_Interpretation (Right_Opnd (N))) then
return False;
elsif Nkind (N) in N_Binary_Op
and then No (Universal_Interpretation (Left_Opnd (N)))
then
return False;
else
return Is_Numeric_Type (T)
and then not In_Open_Scopes (Scope (T))
and then not Is_Potentially_Use_Visible (T)
and then not In_Use (T)
and then not In_Use (Scope (T))
and then
(Nkind (Orig_Node) /= N_Function_Call
or else Nkind (Name (Orig_Node)) /= N_Expanded_Name
or else Entity (Prefix (Name (Orig_Node))) /= Scope (T))
and then not In_Instance;
end if;
end Is_Invisible_Operator;
--------------------
-- Is_Progenitor --
--------------------
function Is_Progenitor
(Iface : Entity_Id;
Typ : Entity_Id) return Boolean
is
begin
return Implements_Interface (Typ, Iface, Exclude_Parents => True);
end Is_Progenitor;
-------------------
-- Is_Subtype_Of --
-------------------
function Is_Subtype_Of (T1 : Entity_Id; T2 : Entity_Id) return Boolean is
S : Entity_Id;
begin
S := Ancestor_Subtype (T1);
while Present (S) loop
if S = T2 then
return True;
else
S := Ancestor_Subtype (S);
end if;
end loop;
return False;
end Is_Subtype_Of;
------------------
-- List_Interps --
------------------
procedure List_Interps (Nam : Node_Id; Err : Node_Id) is
Index : Interp_Index;
It : Interp;
begin
Get_First_Interp (Nam, Index, It);
while Present (It.Nam) loop
if Scope (It.Nam) = Standard_Standard
and then Scope (It.Typ) /= Standard_Standard
then
Error_Msg_Sloc := Sloc (Parent (It.Typ));
Error_Msg_NE ("\\& (inherited) declared#!", Err, It.Nam);
else
Error_Msg_Sloc := Sloc (It.Nam);
Error_Msg_NE ("\\& declared#!", Err, It.Nam);
end if;
Get_Next_Interp (Index, It);
end loop;
end List_Interps;
-----------------
-- New_Interps --
-----------------
procedure New_Interps (N : Node_Id) is
Map_Ptr : Int;
begin
All_Interp.Append (No_Interp);
Map_Ptr := Headers (Hash (N));
if Map_Ptr = No_Entry then
-- Place new node at end of table
Interp_Map.Increment_Last;
Headers (Hash (N)) := Interp_Map.Last;
else
-- Place node at end of chain, or locate its previous entry
loop
if Interp_Map.Table (Map_Ptr).Node = N then
-- Node is already in the table, and is being rewritten.
-- Start a new interp section, retain hash link.
Interp_Map.Table (Map_Ptr).Node := N;
Interp_Map.Table (Map_Ptr).Index := All_Interp.Last;
Set_Is_Overloaded (N, True);
return;
else
exit when Interp_Map.Table (Map_Ptr).Next = No_Entry;
Map_Ptr := Interp_Map.Table (Map_Ptr).Next;
end if;
end loop;
-- Chain the new node
Interp_Map.Increment_Last;
Interp_Map.Table (Map_Ptr).Next := Interp_Map.Last;
end if;
Interp_Map.Table (Interp_Map.Last) := (N, All_Interp.Last, No_Entry);
Set_Is_Overloaded (N, True);
end New_Interps;
---------------------------
-- Operator_Matches_Spec --
---------------------------
function Operator_Matches_Spec (Op, New_S : Entity_Id) return Boolean is
New_First_F : constant Entity_Id := First_Formal (New_S);
Op_Name : constant Name_Id := Chars (Op);
T : constant Entity_Id := Etype (New_S);
New_F : Entity_Id;
Num : Nat;
Old_F : Entity_Id;
T1 : Entity_Id;
T2 : Entity_Id;
begin
-- To verify that a predefined operator matches a given signature, do a
-- case analysis of the operator classes. Function can have one or two
-- formals and must have the proper result type.
New_F := New_First_F;
Old_F := First_Formal (Op);
Num := 0;
while Present (New_F) and then Present (Old_F) loop
Num := Num + 1;
Next_Formal (New_F);
Next_Formal (Old_F);
end loop;
-- Definite mismatch if different number of parameters
if Present (Old_F) or else Present (New_F) then
return False;
-- Unary operators
elsif Num = 1 then
T1 := Etype (New_First_F);
if Nam_In (Op_Name, Name_Op_Subtract, Name_Op_Add, Name_Op_Abs) then
return Base_Type (T1) = Base_Type (T)
and then Is_Numeric_Type (T);
elsif Op_Name = Name_Op_Not then
return Base_Type (T1) = Base_Type (T)
and then Valid_Boolean_Arg (Base_Type (T));
else
return False;
end if;
-- Binary operators
else
T1 := Etype (New_First_F);
T2 := Etype (Next_Formal (New_First_F));
if Nam_In (Op_Name, Name_Op_And, Name_Op_Or, Name_Op_Xor) then
return Base_Type (T1) = Base_Type (T2)
and then Base_Type (T1) = Base_Type (T)
and then Valid_Boolean_Arg (Base_Type (T));
elsif Nam_In (Op_Name, Name_Op_Eq, Name_Op_Ne) then
return Base_Type (T1) = Base_Type (T2)
and then not Is_Limited_Type (T1)
and then Is_Boolean_Type (T);
elsif Nam_In (Op_Name, Name_Op_Lt, Name_Op_Le,
Name_Op_Gt, Name_Op_Ge)
then
return Base_Type (T1) = Base_Type (T2)
and then Valid_Comparison_Arg (T1)
and then Is_Boolean_Type (T);
elsif Nam_In (Op_Name, Name_Op_Add, Name_Op_Subtract) then
return Base_Type (T1) = Base_Type (T2)
and then Base_Type (T1) = Base_Type (T)
and then Is_Numeric_Type (T);
-- For division and multiplication, a user-defined function does not
-- match the predefined universal_fixed operation, except in Ada 83.
elsif Op_Name = Name_Op_Divide then
return (Base_Type (T1) = Base_Type (T2)
and then Base_Type (T1) = Base_Type (T)
and then Is_Numeric_Type (T)
and then (not Is_Fixed_Point_Type (T)
or else Ada_Version = Ada_83))
-- Mixed_Mode operations on fixed-point types
or else (Base_Type (T1) = Base_Type (T)
and then Base_Type (T2) = Base_Type (Standard_Integer)
and then Is_Fixed_Point_Type (T))
-- A user defined operator can also match (and hide) a mixed
-- operation on universal literals.
or else (Is_Integer_Type (T2)
and then Is_Floating_Point_Type (T1)
and then Base_Type (T1) = Base_Type (T));
elsif Op_Name = Name_Op_Multiply then
return (Base_Type (T1) = Base_Type (T2)
and then Base_Type (T1) = Base_Type (T)
and then Is_Numeric_Type (T)
and then (not Is_Fixed_Point_Type (T)
or else Ada_Version = Ada_83))
-- Mixed_Mode operations on fixed-point types
or else (Base_Type (T1) = Base_Type (T)
and then Base_Type (T2) = Base_Type (Standard_Integer)
and then Is_Fixed_Point_Type (T))
or else (Base_Type (T2) = Base_Type (T)
and then Base_Type (T1) = Base_Type (Standard_Integer)
and then Is_Fixed_Point_Type (T))
or else (Is_Integer_Type (T2)
and then Is_Floating_Point_Type (T1)
and then Base_Type (T1) = Base_Type (T))
or else (Is_Integer_Type (T1)
and then Is_Floating_Point_Type (T2)
and then Base_Type (T2) = Base_Type (T));
elsif Nam_In (Op_Name, Name_Op_Mod, Name_Op_Rem) then
return Base_Type (T1) = Base_Type (T2)
and then Base_Type (T1) = Base_Type (T)
and then Is_Integer_Type (T);
elsif Op_Name = Name_Op_Expon then
return Base_Type (T1) = Base_Type (T)
and then Is_Numeric_Type (T)
and then Base_Type (T2) = Base_Type (Standard_Integer);
elsif Op_Name = Name_Op_Concat then
return Is_Array_Type (T)
and then (Base_Type (T) = Base_Type (Etype (Op)))
and then (Base_Type (T1) = Base_Type (T)
or else
Base_Type (T1) = Base_Type (Component_Type (T)))
and then (Base_Type (T2) = Base_Type (T)
or else
Base_Type (T2) = Base_Type (Component_Type (T)));
else
return False;
end if;
end if;
end Operator_Matches_Spec;
-------------------
-- Remove_Interp --
-------------------
procedure Remove_Interp (I : in out Interp_Index) is
II : Interp_Index;
begin
-- Find end of interp list and copy downward to erase the discarded one
II := I + 1;
while Present (All_Interp.Table (II).Typ) loop
II := II + 1;
end loop;
for J in I + 1 .. II loop
All_Interp.Table (J - 1) := All_Interp.Table (J);
end loop;
-- Back up interp index to insure that iterator will pick up next
-- available interpretation.
I := I - 1;
end Remove_Interp;
------------------
-- Save_Interps --
------------------
procedure Save_Interps (Old_N : Node_Id; New_N : Node_Id) is
Map_Ptr : Int;
O_N : Node_Id := Old_N;
begin
if Is_Overloaded (Old_N) then
Set_Is_Overloaded (New_N);
if Nkind (Old_N) = N_Selected_Component
and then Is_Overloaded (Selector_Name (Old_N))
then
O_N := Selector_Name (Old_N);
end if;
Map_Ptr := Headers (Hash (O_N));
while Interp_Map.Table (Map_Ptr).Node /= O_N loop
Map_Ptr := Interp_Map.Table (Map_Ptr).Next;
pragma Assert (Map_Ptr /= No_Entry);
end loop;
New_Interps (New_N);
Interp_Map.Table (Interp_Map.Last).Index :=
Interp_Map.Table (Map_Ptr).Index;
end if;
end Save_Interps;
-------------------
-- Specific_Type --
-------------------
function Specific_Type (Typ_1, Typ_2 : Entity_Id) return Entity_Id is
T1 : constant Entity_Id := Available_View (Typ_1);
T2 : constant Entity_Id := Available_View (Typ_2);
B1 : constant Entity_Id := Base_Type (T1);
B2 : constant Entity_Id := Base_Type (T2);
function Is_Remote_Access (T : Entity_Id) return Boolean;
-- Check whether T is the equivalent type of a remote access type.
-- If distribution is enabled, T is a legal context for Null.
----------------------
-- Is_Remote_Access --
----------------------
function Is_Remote_Access (T : Entity_Id) return Boolean is
begin
return Is_Record_Type (T)
and then (Is_Remote_Call_Interface (T)
or else Is_Remote_Types (T))
and then Present (Corresponding_Remote_Type (T))
and then Is_Access_Type (Corresponding_Remote_Type (T));
end Is_Remote_Access;
-- Start of processing for Specific_Type
begin
if T1 = Any_Type or else T2 = Any_Type then
return Any_Type;
end if;
if B1 = B2 then
return B1;
elsif (T1 = Universal_Integer and then Is_Integer_Type (T2))
or else (T1 = Universal_Real and then Is_Real_Type (T2))
or else (T1 = Universal_Fixed and then Is_Fixed_Point_Type (T2))
or else (T1 = Any_Fixed and then Is_Fixed_Point_Type (T2))
then
return B2;
elsif (T2 = Universal_Integer and then Is_Integer_Type (T1))
or else (T2 = Universal_Real and then Is_Real_Type (T1))
or else (T2 = Universal_Fixed and then Is_Fixed_Point_Type (T1))
or else (T2 = Any_Fixed and then Is_Fixed_Point_Type (T1))
then
return B1;
elsif T2 = Any_String and then Is_String_Type (T1) then
return B1;
elsif T1 = Any_String and then Is_String_Type (T2) then
return B2;
elsif T2 = Any_Character and then Is_Character_Type (T1) then
return B1;
elsif T1 = Any_Character and then Is_Character_Type (T2) then
return B2;
elsif T1 = Any_Access
and then (Is_Access_Type (T2) or else Is_Remote_Access (T2))
then
return T2;
elsif T2 = Any_Access
and then (Is_Access_Type (T1) or else Is_Remote_Access (T1))
then
return T1;
-- In an instance, the specific type may have a private view. Use full
-- view to check legality.
elsif T2 = Any_Access
and then Is_Private_Type (T1)
and then Present (Full_View (T1))
and then Is_Access_Type (Full_View (T1))
and then In_Instance
then
return T1;
elsif T2 = Any_Composite and then Is_Aggregate_Type (T1) then
return T1;
elsif T1 = Any_Composite and then Is_Aggregate_Type (T2) then
return T2;
elsif T1 = Any_Modular and then Is_Modular_Integer_Type (T2) then
return T2;
elsif T2 = Any_Modular and then Is_Modular_Integer_Type (T1) then
return T1;
-- ----------------------------------------------------------
-- Special cases for equality operators (all other predefined
-- operators can never apply to tagged types)
-- ----------------------------------------------------------
-- Ada 2005 (AI-251): T1 and T2 are class-wide types, and T2 is an
-- interface
elsif Is_Class_Wide_Type (T1)
and then Is_Class_Wide_Type (T2)
and then Is_Interface (Etype (T2))
then
return T1;
-- Ada 2005 (AI-251): T1 is a concrete type that implements the
-- class-wide interface T2
elsif Is_Class_Wide_Type (T2)
and then Is_Interface (Etype (T2))
and then Interface_Present_In_Ancestor (Typ => T1,
Iface => Etype (T2))
then
return T1;
elsif Is_Class_Wide_Type (T1)
and then Is_Ancestor (Root_Type (T1), T2)
then
return T1;
elsif Is_Class_Wide_Type (T2)
and then Is_Ancestor (Root_Type (T2), T1)
then
return T2;
elsif Ekind_In (B1, E_Access_Subprogram_Type,
E_Access_Protected_Subprogram_Type)
and then Ekind (Designated_Type (B1)) /= E_Subprogram_Type
and then Is_Access_Type (T2)
then
return T2;
elsif Ekind_In (B2, E_Access_Subprogram_Type,
E_Access_Protected_Subprogram_Type)
and then Ekind (Designated_Type (B2)) /= E_Subprogram_Type
and then Is_Access_Type (T1)
then
return T1;
elsif Ekind_In (T1, E_Allocator_Type,
E_Access_Attribute_Type,
E_Anonymous_Access_Type)
and then Is_Access_Type (T2)
then
return T2;
elsif Ekind_In (T2, E_Allocator_Type,
E_Access_Attribute_Type,
E_Anonymous_Access_Type)
and then Is_Access_Type (T1)
then
return T1;
-- If none of the above cases applies, types are not compatible
else
return Any_Type;
end if;
end Specific_Type;
---------------------
-- Set_Abstract_Op --
---------------------
procedure Set_Abstract_Op (I : Interp_Index; V : Entity_Id) is
begin
All_Interp.Table (I).Abstract_Op := V;
end Set_Abstract_Op;
-----------------------
-- Valid_Boolean_Arg --
-----------------------
-- In addition to booleans and arrays of booleans, we must include
-- aggregates as valid boolean arguments, because in the first pass of
-- resolution their components are not examined. If it turns out not to be
-- an aggregate of booleans, this will be diagnosed in Resolve.
-- Any_Composite must be checked for prior to the array type checks because
-- Any_Composite does not have any associated indexes.
function Valid_Boolean_Arg (T : Entity_Id) return Boolean is
begin
if Is_Boolean_Type (T)
or else Is_Modular_Integer_Type (T)
or else T = Universal_Integer
or else T = Any_Composite
then
return True;
elsif Is_Array_Type (T)
and then T /= Any_String
and then Number_Dimensions (T) = 1
and then Is_Boolean_Type (Component_Type (T))
and then
((not Is_Private_Composite (T) and then not Is_Limited_Composite (T))
or else In_Instance
or else Available_Full_View_Of_Component (T))
then
return True;
else
return False;
end if;
end Valid_Boolean_Arg;
--------------------------
-- Valid_Comparison_Arg --
--------------------------
function Valid_Comparison_Arg (T : Entity_Id) return Boolean is
begin
if T = Any_Composite then
return False;
elsif Is_Discrete_Type (T)
or else Is_Real_Type (T)
then
return True;
elsif Is_Array_Type (T)
and then Number_Dimensions (T) = 1
and then Is_Discrete_Type (Component_Type (T))
and then (not Is_Private_Composite (T) or else In_Instance)
and then (not Is_Limited_Composite (T) or else In_Instance)
then
return True;
elsif Is_Array_Type (T)
and then Number_Dimensions (T) = 1
and then Is_Discrete_Type (Component_Type (T))
and then Available_Full_View_Of_Component (T)
then
return True;
elsif Is_String_Type (T) then
return True;
else
return False;
end if;
end Valid_Comparison_Arg;
------------------
-- Write_Interp --
------------------
procedure Write_Interp (It : Interp) is
begin
Write_Str ("Nam: ");
Print_Tree_Node (It.Nam);
Write_Str ("Typ: ");
Print_Tree_Node (It.Typ);
Write_Str ("Abstract_Op: ");
Print_Tree_Node (It.Abstract_Op);
end Write_Interp;
----------------------
-- Write_Interp_Ref --
----------------------
procedure Write_Interp_Ref (Map_Ptr : Int) is
begin
Write_Str (" Node: ");
Write_Int (Int (Interp_Map.Table (Map_Ptr).Node));
Write_Str (" Index: ");
Write_Int (Int (Interp_Map.Table (Map_Ptr).Index));
Write_Str (" Next: ");
Write_Int (Interp_Map.Table (Map_Ptr).Next);
Write_Eol;
end Write_Interp_Ref;
---------------------
-- Write_Overloads --
---------------------
procedure Write_Overloads (N : Node_Id) is
I : Interp_Index;
It : Interp;
Nam : Entity_Id;
begin
Write_Str ("Overloads: ");
Print_Node_Briefly (N);
if not Is_Overloaded (N) then
Write_Line ("Non-overloaded entity ");
Write_Entity_Info (Entity (N), " ");
elsif Nkind (N) not in N_Has_Entity then
Get_First_Interp (N, I, It);
while Present (It.Nam) loop
Write_Int (Int (It.Typ));
Write_Str (" ");
Write_Name (Chars (It.Typ));
Write_Eol;
Get_Next_Interp (I, It);
end loop;
else
Get_First_Interp (N, I, It);
Write_Line ("Overloaded entity ");
Write_Line (" Name Type Abstract Op");
Write_Line ("===============================================");
Nam := It.Nam;
while Present (Nam) loop
Write_Int (Int (Nam));
Write_Str (" ");
Write_Name (Chars (Nam));
Write_Str (" ");
Write_Int (Int (It.Typ));
Write_Str (" ");
Write_Name (Chars (It.Typ));
if Present (It.Abstract_Op) then
Write_Str (" ");
Write_Int (Int (It.Abstract_Op));
Write_Str (" ");
Write_Name (Chars (It.Abstract_Op));
end if;
Write_Eol;
Get_Next_Interp (I, It);
Nam := It.Nam;
end loop;
end if;
end Write_Overloads;
end Sem_Type;
|
pragma License (Unrestricted);
with Ada.Strings.Bounded;
with Ada.Strings.Bounded_Strings;
with Ada.Text_IO.Generic_Bounded_IO;
generic
with package Bounded is new Strings.Bounded.Generic_Bounded_Length (<>);
package Ada.Text_IO.Bounded_IO is
-- for renaming
package Bounded_Strings_IO is
new Generic_Bounded_IO (
Strings.Bounded_Strings,
Bounded.Bounded_Strings,
Put => Put,
Put_Line => Put_Line,
Get_Line => Get_Line);
procedure Put (
File : File_Type; -- Output_File_Type
Item : Bounded.Bounded_String)
renames Bounded_Strings_IO.Put;
procedure Put (
Item : Bounded.Bounded_String)
renames Bounded_Strings_IO.Put;
procedure Put_Line (
File : File_Type; -- Output_File_Type
Item : Bounded.Bounded_String)
renames Bounded_Strings_IO.Put_Line;
procedure Put_Line (
Item : Bounded.Bounded_String)
renames Bounded_Strings_IO.Put_Line;
function Get_Line (
File : File_Type) -- Input_File_Type
return Bounded.Bounded_String
renames Bounded_Strings_IO.Get_Line;
function Get_Line
return Bounded.Bounded_String
renames Bounded_Strings_IO.Get_Line;
procedure Get_Line (
File : File_Type; -- Input_File_Type
Item : out Bounded.Bounded_String)
renames Bounded_Strings_IO.Get_Line;
procedure Get_Line (
Item : out Bounded.Bounded_String)
renames Bounded_Strings_IO.Get_Line;
end Ada.Text_IO.Bounded_IO;
|
--------------------------------------------------------------------------------------------------------------------
-- 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 Interfaces.C.Strings;
with SDL.Error;
package body SDL.RWops is
use type C.size_t;
use type C.Strings.chars_ptr;
procedure SDL_Free (Mem : in C.Strings.chars_ptr) with
Import => True,
Convention => C,
External_Name => "SDL_free";
function Base_Path return UTF_Strings.UTF_String is
function SDL_Get_Base_Path return C.Strings.chars_ptr with
Import => True,
Convention => C,
External_Name => "SDL_GetBasePath";
C_Path : constant C.Strings.chars_ptr := SDL_Get_Base_Path;
begin
if C_Path = C.Strings.Null_Ptr then
raise RWops_Error with SDL.Error.Get;
end if;
declare
Ada_Path : constant UTF_Strings.UTF_String := C.Strings.Value (C_Path);
begin
SDL_Free (C_Path);
return Ada_Path;
end;
end Base_Path;
function Preferences_Path (Organisation : in UTF_Strings.UTF_String;
Application : in UTF_Strings.UTF_String) return UTF_Strings.UTF_String
is
function SDL_Get_Pref_Path (Organisation : in C.Strings.chars_ptr;
Application : in C.Strings.chars_ptr) return C.Strings.chars_ptr with
Import => True,
Convention => C,
External_Name => "SDL_GetPrefPath";
C_Organisation : C.Strings.chars_ptr;
C_Application : C.Strings.chars_ptr;
C_Path : C.Strings.chars_ptr;
begin
C_Organisation := C.Strings.New_String (Organisation);
C_Application := C.Strings.New_String (Application);
C_Path := SDL_Get_Pref_Path (Organisation => C_Organisation,
Application => C_Application);
C.Strings.Free (C_Organisation);
C.Strings.Free (C_Application);
if C_Path = C.Strings.Null_Ptr then
raise RWops_Error with SDL.Error.Get;
end if;
declare
Ada_Path : constant UTF_Strings.UTF_String := C.Strings.Value (C_Path);
begin
SDL_Free (C_Path);
return Ada_Path;
end;
end Preferences_Path;
procedure Close (Ops : in RWops) is
Result : C.int := -1;
begin
Result := Ops.Close (RWops_Pointer (Ops));
if Result /= 0 then
raise RWops_Error with SDL.Error.Get;
end if;
end Close;
function From_File (File_Name : in UTF_Strings.UTF_String;
Mode : in File_Mode) return RWops
is
function SDL_RW_From_File (File : in C.Strings.chars_ptr;
Mode : in C.Strings.chars_ptr) return RWops_Pointer with
Import => True,
Convention => C,
External_Name => "SDL_RWFromFile";
Mode_String : String (1 .. 3) := " ";
RWop : RWops_Pointer;
C_File_Name : C.Strings.chars_ptr := C.Strings.Null_Ptr;
C_File_Mode : C.Strings.chars_ptr := C.Strings.Null_Ptr;
begin
case Mode is
when Read =>
Mode_String := "r ";
when Create_To_Write =>
Mode_String := "w ";
when Append =>
Mode_String := "a ";
when Read_Write =>
Mode_String := "r+ ";
when Create_To_Read_Write =>
Mode_String := "w+ ";
when Append_And_Read =>
Mode_String := "a+ ";
when Read_Binary =>
Mode_String := "rb ";
when Create_To_Write_Binary =>
Mode_String := "wb ";
when Append_Binary =>
Mode_String := "ab ";
when Read_Write_Binary =>
Mode_String := "r+b";
when Create_To_Read_Write_Binary =>
Mode_String := "w+b";
when Append_And_Read_Binary =>
Mode_String := "a+b";
end case;
C_File_Name := C.Strings.New_String (File_Name);
C_File_Mode := C.Strings.New_String (Mode_String);
RWop := SDL_RW_From_File (File => C_File_Name, Mode => C_File_Mode);
C.Strings.Free (C_File_Name);
C.Strings.Free (C_File_Mode);
if RWop = null then
raise RWops_Error with SDL.Error.Get;
end if;
return RWops (RWop);
end From_File;
procedure From_File (File_Name : in UTF_Strings.UTF_String;
Mode : in File_Mode;
Ops : out RWops) is
begin
Ops := From_File (File_Name, Mode);
end From_File;
function Seek (Context : in RWops;
Offset : in Offsets;
Whence : in Whence_Type) return Offsets
is
Returned_Offset : SDL.RWops.Offsets := SDL.RWops.Error_Offset;
begin
Returned_Offset := Context.Seek (Context => RWops_Pointer (Context),
Offset => Offset,
Whence => Whence);
if Returned_Offset = SDL.RWops.Error_Offset then
raise RWops_Error with SDL.Error.Get;
end if;
return Returned_Offset;
end Seek;
function Size (Context : in RWops) return Offsets is
Returned_Offset : SDL.RWops.Offsets := SDL.RWops.Error_Offset;
begin
Returned_Offset := Context.Size (Context => RWops_Pointer (Context));
if Returned_Offset < Null_Offset then
raise RWops_Error with SDL.Error.Get;
end if;
return Returned_Offset;
end Size;
function Tell (Context : in RWops) return Offsets is
Returned_Offset : SDL.RWops.Offsets := SDL.RWops.Error_Offset;
begin
-- In C SDL_RWtell is a macro doing just this.
Returned_Offset := Context.Seek (Context => RWops_Pointer (Context),
Offset => Null_Offset,
Whence => RW_Seek_Cur);
if Returned_Offset = SDL.RWops.Error_Offset then
raise RWops_Error with SDL.Error.Get;
end if;
return Returned_Offset;
end Tell;
procedure Write_BE_16 (Destination : in RWops; Value : in Uint16) is
function SDL_Write_BE_16 (Destination : in RWops; Value : in Uint16) return C.size_t with
Import => True,
Convention => C,
External_Name => "SDL_WriteBE16";
Result : C.size_t := 0;
begin
Result := SDL_Write_BE_16 (Destination, Value);
if Result = 0 then
raise RWops_Error with SDL.Error.Get;
end if;
end Write_BE_16;
procedure Write_BE_32 (Destination : in RWops; Value : in Uint32) is
function SDL_Write_BE_32 (Destination : in RWops; Value : in Uint32) return C.size_t with
Import => True,
Convention => C,
External_Name => "SDL_WriteBE32";
Result : C.size_t := 0;
begin
Result := SDL_Write_BE_32 (Destination, Value);
if Result = 0 then
raise RWops_Error with SDL.Error.Get;
end if;
end Write_BE_32;
procedure Write_BE_64 (Destination : in RWops; Value : in Uint64) is
function SDL_Write_BE_64 (Destination : in RWops; Value : in Uint64) return C.size_t with
Import => True,
Convention => C,
External_Name => "SDL_WriteBE64";
Result : C.size_t := 0;
begin
Result := SDL_Write_BE_64 (Destination, Value);
if Result = 0 then
raise RWops_Error with SDL.Error.Get;
end if;
end Write_BE_64;
procedure Write_LE_16 (Destination : in RWops; Value : in Uint16) is
function SDL_Write_LE_16 (Destination : in RWops; Value : in Uint16) return C.size_t with
Import => True,
Convention => C,
External_Name => "SDL_WriteLE16";
Result : C.size_t := 0;
begin
Result := SDL_Write_LE_16 (Destination, Value);
if Result = 0 then
raise RWops_Error with SDL.Error.Get;
end if;
end Write_LE_16;
procedure Write_LE_32 (Destination : in RWops; Value : in Uint32) is
function SDL_Write_LE_32 (Destination : in RWops; Value : in Uint32) return C.size_t with
Import => True,
Convention => C,
External_Name => "SDL_WriteLE32";
Result : C.size_t := 0;
begin
Result := SDL_Write_LE_32 (Destination, Value);
if Result = 0 then
raise RWops_Error with SDL.Error.Get;
end if;
end Write_LE_32;
procedure Write_LE_64 (Destination : in RWops; Value : in Uint64) is
function SDL_Write_LE_64 (Destination : in RWops; Value : in Uint64) return C.size_t with
Import => True,
Convention => C,
External_Name => "SDL_WriteLE64";
Result : C.size_t := 0;
begin
Result := SDL_Write_LE_64 (Destination, Value);
if Result = 0 then
raise RWops_Error with SDL.Error.Get;
end if;
end Write_LE_64;
procedure Write_U_8 (Destination : in RWops; Value : in Uint8) is
function SDL_Write_U_8 (Destination : in RWops; Value : in Uint8) return C.size_t with
Import => True,
Convention => C,
External_Name => "SDL_WriteU8";
Result : C.size_t := 0;
begin
Result := SDL_Write_U_8 (Destination, Value);
if Result = 0 then
raise RWops_Error with SDL.Error.Get;
end if;
end Write_U_8;
function Is_Null (Source : in RWops) return Boolean is
begin
return (if Source = null then True else False);
end Is_Null;
end SDL.RWops;
|
-- ----------------------------------------------------------------- --
-- AdaSDL --
-- Thin binding to Simple Direct Media Layer --
-- Copyright (C) 2000-2012 A.M.F.Vargas --
-- Antonio M. M. Ferreira Vargas --
-- Manhente - Barcelos - Portugal --
-- http://adasdl.sourceforge.net --
-- E-mail: amfvargas@gmail.com --
-- ----------------------------------------------------------------- --
-- --
-- This library is free software; you can redistribute it and/or --
-- modify it under the terms of the GNU General Public --
-- License as published by the Free Software Foundation; either --
-- version 2 of the License, or (at your option) any later version. --
-- --
-- This library is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. --
-- --
-- You should have received a copy of the GNU General Public --
-- License along with this library; if not, write to the --
-- Free Software Foundation, Inc., 59 Temple Place - Suite 330, --
-- Boston, MA 02111-1307, USA. --
-- --
-- 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. --
-- ----------------------------------------------------------------- --
-- **************************************************************** --
-- This is an Ada binding to SDL ( Simple DirectMedia Layer from --
-- Sam Lantinga - www.libsld.org ) --
-- **************************************************************** --
-- In order to help the Ada programmer, the comments in this file --
-- are, in great extent, a direct copy of the original text in the --
-- SDL header files. --
-- **************************************************************** --
package SDL.Audio.Extra is
-- Native audio byte ordering
AUDIO_U16SYS : constant Format_Flag := Get_Audio_U16_Sys;
AUDIO_S16SYS : constant Format_Flag := Get_Audio_S16_Sys;
end SDL.Audio.Extra;
|
-- Copyright 2008-2019 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package Pck is
type Position is record
X : Integer;
Y : Integer;
end record;
type Circle is record
Pos : Position;
Radius : Integer;
end record;
procedure Do_Nothing (C : in out Circle);
end Pck;
|
--
-- ABench2020 Benchmark Suite
--
-- Softmax Program
--
-- Licensed under the MIT License. See LICENSE file in the ABench root
-- directory for license information.
--
-- Uncomment the lines below to print the result.
-- with Ada.Text_IO; use Ada.Text_IO;
procedure Softmax is
type Vector is array (1..15) of Integer;
Result : array (1..15) of Float;
Exp : constant := 2.71828;
procedure Calculate_Softmax (Sample: Vector) is
Denonminator : Float := 0.0;
begin
for I in Sample'Range loop
Denonminator := Denonminator + (Exp ** Sample (I));
end loop;
for I in Sample'Range loop
Result (I) := (Exp ** Sample (I)) / Denonminator;
end loop;
end;
Sample : Vector := (1, 5, 3, 7, 4, 10, 4, 9, 4, 1, 9, 12, 3, 8, 5);
begin
loop
Calculate_Softmax (Sample);
Sample := (1, 5, 3, 7, 4, 10, 4, 9, 4, 1, 9, 12, 3, 8, 5);
end loop;
-- Uncomment the lines below to print the result.
-- for I in Sample'Range loop
-- Put (Float'Image (Result (I)) & " ");
-- end loop;
end;
|
-- ___ _ ___ _ _ --
-- / __| |/ (_) | | Common SKilL implementation --
-- \__ \ ' <| | | |__ implementation of builtin field types --
-- |___/_|\_\_|_|____| by: Timm Felden --
-- --
pragma Ada_2012;
with Ada.Containers;
with Ada.Containers.Doubly_Linked_Lists;
with Ada.Containers.Hashed_Maps;
with Ada.Containers.Hashed_Sets;
with Ada.Containers.Vectors;
with Skill.Types;
with Skill.Hashes; use Skill.Hashes;
with Skill.Types.Pools;
with Ada.Tags;
package body Skill.Field_Types.Plain_Types is
procedure Write_Box
(This : access Field_Type;
Output : Streams.Writer.Sub_Stream;
Target : Types.Box)
is
begin
Write_Single (Output, Unboxed (Target));
end Write_Box;
end Skill.Field_Types.Plain_Types;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M --
-- --
-- S p e c --
-- (DragonFly BSD/x86_64 Version) --
-- --
-- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- apply solely to the contents of the part following the private keyword. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
package System is
pragma Pure;
-- Note that we take advantage of the implementation permission to make
-- this unit Pure instead of Preelaborable; see RM 13.7.1(15). In Ada
-- 2005, this is Pure in any case (AI-362).
pragma No_Elaboration_Code_All;
-- Allow the use of that restriction in units that WITH this unit
type Name is (SYSTEM_NAME_GNAT);
System_Name : constant Name := SYSTEM_NAME_GNAT;
-- System-Dependent Named Numbers
Min_Int : constant := Long_Long_Integer'First;
Max_Int : constant := Long_Long_Integer'Last;
Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
Max_Nonbinary_Modulus : constant := 2 ** Integer'Size - 1;
Max_Base_Digits : constant := Long_Long_Float'Digits;
Max_Digits : constant := Long_Long_Float'Digits;
Max_Mantissa : constant := 63;
Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
Tick : constant := 0.000_001;
-- Storage-related Declarations
type Address is private;
pragma Preelaborable_Initialization (Address);
Null_Address : constant Address;
Storage_Unit : constant := 8;
Word_Size : constant := 64;
Memory_Size : constant := 2 ** 64;
-- Address comparison
function "<" (Left, Right : Address) return Boolean;
function "<=" (Left, Right : Address) return Boolean;
function ">" (Left, Right : Address) return Boolean;
function ">=" (Left, Right : Address) return Boolean;
function "=" (Left, Right : Address) return Boolean;
pragma Import (Intrinsic, "<");
pragma Import (Intrinsic, "<=");
pragma Import (Intrinsic, ">");
pragma Import (Intrinsic, ">=");
pragma Import (Intrinsic, "=");
-- Other System-Dependent Declarations
type Bit_Order is (High_Order_First, Low_Order_First);
Default_Bit_Order : constant Bit_Order := Low_Order_First;
pragma Warnings (Off, Default_Bit_Order); -- kill constant condition warning
-- Priority-related Declarations (RM D.1)
Max_Priority : constant Positive := 30;
Max_Interrupt_Priority : constant Positive := 31;
subtype Any_Priority is Integer range 0 .. 31;
subtype Priority is Any_Priority range 0 .. 30;
subtype Interrupt_Priority is Any_Priority range 31 .. 31;
Default_Priority : constant Priority := 15;
private
type Address is mod Memory_Size;
Null_Address : constant Address := 0;
--------------------------------------
-- System Implementation Parameters --
--------------------------------------
-- These parameters provide information about the target that is used
-- by the compiler. They are in the private part of System, where they
-- can be accessed using the special circuitry in the Targparm unit
-- whose source should be consulted for more detailed descriptions
-- of the individual switch values.
Backend_Divide_Checks : constant Boolean := False;
Backend_Overflow_Checks : constant Boolean := True;
Command_Line_Args : constant Boolean := True;
Configurable_Run_Time : constant Boolean := False;
Denorm : constant Boolean := True;
Duration_32_Bits : constant Boolean := False;
Exit_Status_Supported : constant Boolean := True;
Fractional_Fixed_Ops : constant Boolean := False;
Frontend_Layout : constant Boolean := False;
Machine_Overflows : constant Boolean := False;
Machine_Rounds : constant Boolean := True;
Preallocated_Stacks : constant Boolean := False;
Signed_Zeros : constant Boolean := True;
Stack_Check_Default : constant Boolean := False;
Stack_Check_Probes : constant Boolean := True;
Stack_Check_Limits : constant Boolean := False;
Support_Aggregates : constant Boolean := True;
Support_Atomic_Primitives : constant Boolean := True;
Support_Composite_Assign : constant Boolean := True;
Support_Composite_Compare : constant Boolean := True;
Support_Long_Shifts : constant Boolean := True;
Always_Compatible_Rep : constant Boolean := False;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
Frontend_Exceptions : constant Boolean := False;
ZCX_By_Default : constant Boolean := True;
end System;
|
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Rain --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright 2020 Thomas E. Dickey --
-- Copyright 1998-2007,2008 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Laurent Pautet <pautet@gnat.com>
-- Modified by: Juergen Pfeifer, 1997
-- Version Control
-- $Revision: 1.9 $
-- $Date: 2020/02/02 23:34:34 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- --
with ncurses2.util; use ncurses2.util;
with Ada.Numerics.Float_Random; use Ada.Numerics.Float_Random;
with Status; use Status;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
procedure Rain is
Visibility : Cursor_Visibility;
subtype X_Position is Line_Position;
subtype Y_Position is Column_Position;
Xpos : array (1 .. 5) of X_Position;
Ypos : array (1 .. 5) of Y_Position;
done : Boolean;
c : Key_Code;
N : Integer;
G : Generator;
Max_X, X : X_Position;
Max_Y, Y : Y_Position;
procedure Next (J : in out Integer);
procedure Cursor (X : X_Position; Y : Y_Position);
procedure Next (J : in out Integer) is
begin
if J = 5 then
J := 1;
else
J := J + 1;
end if;
end Next;
procedure Cursor (X : X_Position; Y : Y_Position) is
begin
Move_Cursor (Line => X, Column => Y);
end Cursor;
pragma Inline (Cursor);
begin
Init_Screen;
Set_NL_Mode;
Set_Echo_Mode (False);
Visibility := Invisible;
Set_Cursor_Visibility (Visibility);
Set_Timeout_Mode (Standard_Window, Non_Blocking, 0);
Max_X := Lines - 5;
Max_Y := Columns - 5;
for I in Xpos'Range loop
Xpos (I) := X_Position (Float (Max_X) * Random (G)) + 2;
Ypos (I) := Y_Position (Float (Max_Y) * Random (G)) + 2;
end loop;
N := 1;
done := False;
while not done and Process.Continue loop
X := X_Position (Float (Max_X) * Random (G)) + 2;
Y := Y_Position (Float (Max_Y) * Random (G)) + 2;
Cursor (X, Y);
Add (Ch => '.');
Cursor (Xpos (N), Ypos (N));
Add (Ch => 'o');
--
Next (N);
Cursor (Xpos (N), Ypos (N));
Add (Ch => 'O');
--
Next (N);
Cursor (Xpos (N) - 1, Ypos (N));
Add (Ch => '-');
Cursor (Xpos (N), Ypos (N) - 1);
Add (Str => "|.|");
Cursor (Xpos (N) + 1, Ypos (N));
Add (Ch => '-');
--
Next (N);
Cursor (Xpos (N) - 2, Ypos (N));
Add (Ch => '-');
Cursor (Xpos (N) - 1, Ypos (N) - 1);
Add (Str => "/\\");
Cursor (Xpos (N), Ypos (N) - 2);
Add (Str => "| O |");
Cursor (Xpos (N) + 1, Ypos (N) - 1);
Add (Str => "\\/");
Cursor (Xpos (N) + 2, Ypos (N));
Add (Ch => '-');
--
Next (N);
Cursor (Xpos (N) - 2, Ypos (N));
Add (Ch => ' ');
Cursor (Xpos (N) - 1, Ypos (N) - 1);
Add (Str => " ");
Cursor (Xpos (N), Ypos (N) - 2);
Add (Str => " ");
Cursor (Xpos (N) + 1, Ypos (N) - 1);
Add (Str => " ");
Cursor (Xpos (N) + 2, Ypos (N));
Add (Ch => ' ');
Xpos (N) := X;
Ypos (N) := Y;
c := Getchar;
case c is
when Character'Pos ('q') => done := True;
when Character'Pos ('Q') => done := True;
when Character'Pos ('s') => Set_NoDelay_Mode (Standard_Window, False);
when Character'Pos (' ') => Set_NoDelay_Mode (Standard_Window, True);
when others => null;
end case;
Nap_Milli_Seconds (50);
end loop;
Visibility := Normal;
Set_Cursor_Visibility (Visibility);
End_Windows;
Curses_Free_All;
end Rain;
|
-----------------------------------------------------------------------
-- Util.Beans.Objects.Discrete_Tests - Generic simple test for discrete object types
-- Copyright (C) 2009, 2010, 2011, 2018 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Containers;
with Ada.Strings.Fixed;
with Ada.Text_IO;
with Ada.Calendar;
with Util.Test_Caller;
with Util.Beans.Objects.Hash;
package body Util.Beans.Objects.Discrete_Tests is
use Ada.Strings.Fixed;
use Ada.Containers;
procedure Test_Eq (T : Test; V : String; N : Test_Type);
procedure Test_Conversion (T : Test; V : String; N : Test_Type);
procedure Test_Lt_Gt (T : Test; V : String; N : Test_Type);
procedure Test_Sub (T : Test; V : String; N : Test_Type);
procedure Test_Add (T : Test; V : String; N : Test_Type);
procedure Test_Perf (T : Test; V : String; N : Test_Type);
procedure Test_Hash (T : in out Test);
-- Generic test for To_Object and To_XXX types
-- Several values are specified in the Test_Values string.
generic
with procedure Basic_Test (T : in Test; V : String; N : Test_Type);
procedure Test_Basic_Object (T : in out Test);
procedure Test_Basic_Object (T : in out Test) is
pragma Unmodified (T);
Pos, Next : Natural;
begin
Pos := Test_Values'First;
while Pos <= Test_Values'Last loop
Next := Index (Test_Values, ",", Pos);
if Next < Pos then
Next := Test_Values'Last + 1;
end if;
declare
V : constant String := Test_Values (Pos .. Next - 1);
N : constant Test_Type := Value (V);
begin
Basic_Test (T, V, N);
end;
Pos := Next + 1;
end loop;
end Test_Basic_Object;
-- ------------------------------
-- Test Util.Beans.Objects.To_Object
-- ------------------------------
procedure Test_Conversion (T : Test; V : String; N : Test_Type) is
Value : Util.Beans.Objects.Object;
begin
Value := To_Object (V);
T.Assert (Condition => To_Type (Value) = N,
Message => Test_Name & " returned invalid value: "
& To_String (Value) & " when we expected: " & V);
T.Assert (Condition => V = To_String (Value),
Message => Test_Name & ".To_String returned invalid value: "
& To_String (Value) & " when we expected: " & V);
end Test_Conversion;
procedure Test_To_Object is new Test_Basic_Object (Basic_Test => Test_Conversion);
-- ------------------------------
-- Test Util.Beans.Objects.Hash
-- ------------------------------
procedure Test_Hash (T : in out Test) is
pragma Unmodified (T);
Pos, Next : Natural;
Hash_Values : array (Test_Values'Range) of Hash_Type := (others => 0);
Nb_Hash : Natural := 0;
begin
Pos := Test_Values'First;
while Pos <= Test_Values'Last loop
Next := Index (Test_Values, ",", Pos);
if Next < Pos then
Next := Test_Values'Last + 1;
end if;
declare
V : constant String := Test_Values (Pos .. Next - 1);
N : constant Test_Type := Value (V);
Value : constant Util.Beans.Objects.Object := To_Object_Test (N);
H : constant Hash_Type := Util.Beans.Objects.Hash (Value);
Found : Boolean := False;
begin
for J in 1 .. Nb_Hash loop
if Hash_Values (J) = H then
Found := True;
end if;
end loop;
if not Found then
Nb_Hash := Nb_Hash + 1;
Hash_Values (Nb_Hash) := H;
end if;
end;
Pos := Next + 1;
end loop;
Ada.Text_IO.Put_Line ("Found " & Natural'Image (Nb_Hash) & " hash values");
T.Assert (Nb_Hash > 1, "Only one hash value found");
end Test_Hash;
-- ------------------------------
-- Test Util.Beans.Objects."+"
-- ------------------------------
procedure Test_Add (T : Test; V : String; N : Test_Type) is
Value : Util.Beans.Objects.Object := To_Object_Test (N);
begin
Value := Value + To_Object_Test (N);
T.Assert (Condition => To_Type (Value) = N + N,
Message => Test_Name & " returned invalid value: "
& To_String (Value) & " when we expected: " & V);
end Test_Add;
procedure Test_Add is new Test_Basic_Object (Test_Add);
-- ------------------------------
-- Test Util.Beans.Objects."-"
-- ------------------------------
procedure Test_Sub (T : Test; V : String; N : Test_Type) is
pragma Unreferenced (V);
Value : Util.Beans.Objects.Object;
begin
Value := To_Object_Test (N) - To_Object_Test (N);
T.Assert (Condition => To_Type (Value) = N - N,
Message => Test_Name & " returned invalid value: "
& To_String (Value) & " when we expected: 0");
end Test_Sub;
procedure Test_Sub is new Test_Basic_Object (Test_Sub);
-- ------------------------------
-- Test Util.Beans.Objects."<" and Util.Beans.Objects.">"
-- ------------------------------
procedure Test_Lt_Gt (T : Test; V : String; N : Test_Type) is
Res : Boolean;
Is_Neg : constant Boolean := Index (V, "-") = V'First;
O : constant Util.Beans.Objects.Object := To_Object_Test (N);
begin
Res := To_Object_Test (N) < To_Object_Test (N);
T.Assert (Condition => Res = False,
Message => Test_Name & ".'<' returned invalid value: "
& Boolean'Image (Res) & " when we expected: false");
Res := To_Object_Test (N) > To_Object_Test (N);
T.Assert (Condition => Res = False,
Message => Test_Name & ".'>' returned invalid value: "
& Boolean'Image (Res) & " when we expected: false");
Res := To_Object_Test (N) + To_Object_Test (N) < To_Object_Test (N);
T.Assert (Condition => Res = Is_Neg,
Message => Test_Name & ".'<' returned invalid value: "
& Boolean'Image (Res) & " when we expected: "
& Boolean'Image (Is_Neg)
& " with value: " & V & "Num=" & Long_Long_Integer'Image (To_Long_Long_Integer (O))
& " Sum=" & Long_Long_Integer'Image (To_Long_Long_Integer (O + O)));
Res := To_Object_Test (N) > To_Object_Test (N) + To_Object_Test (N);
T.Assert (Condition => Res = Is_Neg,
Message => Test_Name & ".'>' returned invalid value: "
& Boolean'Image (Res) & " when we expected: "
& Boolean'Image (Is_Neg)
& " with value: " & V);
if V /= "0" and V /= "false" and V /= "true" then
Res := To_Object_Test (N) < To_Object_Test (N) + To_Object_Test (N);
T.Assert (Condition => Res = not Is_Neg,
Message => Test_Name & ".'<' returned invalid value: "
& Boolean'Image (Res) & " when we expected: "
& Boolean'Image (not Is_Neg)
& " with value: " & V);
Res := To_Object_Test (N) + To_Object_Test (N) > To_Object_Test (N);
T.Assert (Condition => Res = not Is_Neg,
Message => Test_Name & ".'>' returned invalid value: "
& Boolean'Image (Res) & " when we expected: "
& Boolean'Image (not Is_Neg)
& " with value: " & V);
end if;
end Test_Lt_Gt;
procedure Test_Lt_Gt is new Test_Basic_Object (Test_Lt_Gt);
-- ------------------------------
-- Test Util.Beans.Objects."="
-- ------------------------------
procedure Test_Eq (T : Test; V : String; N : Test_Type) is
Res : Boolean;
begin
Res := To_Object_Test (N) = To_Object_Test (N);
T.Assert (Condition => Res,
Message => Test_Name & ".'=' returned invalid value: "
& Boolean'Image (Res) & " when we expected: true");
Res := To_Object_Test (N) = To_Object ("Something" & V);
T.Assert (Condition => Res = False,
Message => Test_Name & ".'=' returned invalid value: "
& Boolean'Image (Res) & " where we expected: False");
end Test_Eq;
procedure Test_Eq is new Test_Basic_Object (Test_Eq);
-- ------------------------------
-- Test Util.Beans.Objects."="
-- ------------------------------
procedure Test_Perf (T : Test; V : String; N : Test_Type) is
pragma Unreferenced (T, V);
use Ada.Calendar;
Start : Ada.Calendar.Time;
Value : constant Util.Beans.Objects.Object := To_Object_Test (N);
D : Duration;
begin
Start := Ada.Calendar.Clock;
for I in 1 .. 1_000 loop
declare
V : Util.Beans.Objects.Object := Value;
begin
V := V + V;
pragma Unreferenced (V);
end;
end loop;
D := Ada.Calendar.Clock - Start;
Ada.Text_IO.Put_Line ("Perf " & Test_Name & ": " & Duration'Image (D * 1000.0));
end Test_Perf;
procedure Test_Perf is new Test_Basic_Object (Test_Perf);
package Caller is new Util.Test_Caller (Test, "Objects." & Test_Name);
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test Util.Beans.Objects.To_Object." & Test_Name,
Test_To_Object'Access);
Caller.Add_Test (Suite, "Test Util.Beans.Objects.To_String." & Test_Name,
Test_To_Object'Access);
Caller.Add_Test (Suite, "Test Util.Beans.Objects.'='." & Test_Name,
Test_Eq'Access);
Caller.Add_Test (Suite, "Test Util.Beans.Objects.'+'." & Test_Name,
Test_Add'Access);
Caller.Add_Test (Suite, "Test Util.Beans.Objects.'-'." & Test_Name,
Test_Sub'Access);
Caller.Add_Test (Suite, "Test Util.Beans.Objects.'<'." & Test_Name,
Test_Lt_Gt'Access);
Caller.Add_Test (Suite, "Test Util.Beans.Objects.'>'." & Test_Name,
Test_Lt_Gt'Access);
Caller.Add_Test (Suite, "Performance Util.Beans.Objects.'>'." & Test_Name,
Test_Perf'Access);
Caller.Add_Test (Suite, "Test Util.Beans.Objects.Hash." & Test_Name,
Test_Hash'Access);
end Add_Tests;
end Util.Beans.Objects.Discrete_Tests;
|
------------------------------------------------------------------------------
-- --
-- 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.Shaders.Internals is
----------------------
-- Get_WebGL_Shader --
----------------------
function Get_WebGL_Shader
(Self : not null access OpenGL_Shader'Class)
return WebAPI.WebGL.Shaders.WebGL_Shader_Access is
begin
return Self.Shader;
end Get_WebGL_Shader;
end OpenGL.Shaders.Internals;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010-2017 Vadim Godunko <vgodunko@gmail.com> --
-- --
-- Matreshka is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the Free --
-- Software Foundation; either version 2, or (at your option) any later --
-- version. Matreshka 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 Matreshka; 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. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Ada.Characters.Latin_1;
with Ada.Strings.Fixed;
with Ada.Strings.Unbounded;
package body Matreshka.Internals.Regexps.Engine.Debug is
use Matreshka.Internals.Utf16;
type State is record
PC : Positive;
SP : Utf16_String_Index;
SI : Positive;
SS : Regexps.Slice_Array (0 .. 9);
end record;
----------
-- Dump --
----------
function Dump (Program : Engine.Program) return String is
use Ada.Characters.Latin_1;
use Ada.Strings;
use Ada.Strings.Fixed;
use Ada.Strings.Unbounded;
Result : Unbounded_String;
begin
for J in Program.Instructions'Range loop
declare
Address_Image : constant String := Trim (Integer'Image (J), Both);
Address_Buffer : String (1 .. 4) := (others => ' ');
Instruction : constant Engine.Instruction
:= Program.Instructions (J);
begin
Address_Buffer (4 - Address_Image'Length + 1 .. 4) :=
Address_Image;
Append (Result, Address_Buffer);
Append (Result, ' ');
case Instruction.Kind is
when None =>
Append (Result, "nop");
when I_Terminate =>
Append
(Result,
"terminate ["
& Trim (Integer'Image (Instruction.Next), Both)
& "]");
when Split =>
Append
(Result,
"split ["
& Trim (Integer'Image (Instruction.Next), Both)
& "], ["
& Trim (Integer'Image (Instruction.Another), Both)
& "]");
when Any_Code_Point =>
Append
(Result,
"char is any ["
& Trim (Integer'Image (Instruction.Next), Both)
& "]");
when Code_Point =>
Append
(Result,
"char is "
& Wide_Wide_Character'Image
(Wide_Wide_Character'Val (Instruction.Code))
& " ["
& Trim (Integer'Image (Instruction.Next), Both)
& "]");
when Code_Range =>
Append
(Result,
"char in "
& Wide_Wide_Character'Image
(Wide_Wide_Character'Val (Instruction.Low))
& " .. "
& Wide_Wide_Character'Image
(Wide_Wide_Character'Val (Instruction.High)));
if Instruction.Negate then
Append (Result, " {negate}");
end if;
Append
(Result,
" ["
& Trim (Integer'Image (Instruction.Next), Both)
& "]");
when I_Property =>
case Instruction.Value.Kind is
when None =>
raise Program_Error;
when General_Category =>
Append (Result, "char General_Category is");
for K in Instruction.Value.GC_Flags'Range loop
if Instruction.Value.GC_Flags (K) then
Append
(Result,
' '
& Matreshka.Internals.Unicode.Ucd.
General_Category'Image
(K));
end if;
end loop;
when Binary =>
Append
(Result,
"char is "
& Matreshka.Internals.Unicode.Ucd.
Boolean_Properties'Image
(Instruction.Value.Property));
end case;
if Instruction.Negative then
Append (Result, " {negative}");
end if;
when Match =>
Append (Result, "match");
when Save =>
Append
(Result,
"save $"
& Trim (Integer'Image (Instruction.Slot), Both)
& " ");
if Instruction.Start then
Append (Result, "{begin}");
else
Append (Result, "{end}");
end if;
Append
(Result,
" ["
& Trim (Integer'Image (Instruction.Next), Both)
& "]");
when I_Anchor =>
Append (Result, "anchor");
if Instruction.Start_Of_Line then
Append (Result, " {start of line}");
end if;
if Instruction.End_Of_Line then
Append (Result, " {end of line}");
end if;
Append
(Result,
" ["
& Trim (Integer'Image (Instruction.Next), Both)
& "]");
end case;
Append (Result, LF);
end;
end loop;
return To_String (Result);
end Dump;
end Matreshka.Internals.Regexps.Engine.Debug;
|
-- This spec has been automatically generated from STM32WB55x.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.SAI is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype ACR1_MODE_Field is HAL.UInt2;
subtype ACR1_PRTCFG_Field is HAL.UInt2;
subtype ACR1_DS_Field is HAL.UInt3;
subtype ACR1_SYNCEN_Field is HAL.UInt2;
subtype ACR1_MCKDIV_Field is HAL.UInt6;
type ACR1_Register is record
MODE : ACR1_MODE_Field := 16#0#;
PRTCFG : ACR1_PRTCFG_Field := 16#0#;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
DS : ACR1_DS_Field := 16#0#;
LSBFIRST : Boolean := False;
CKSTR : Boolean := False;
SYNCEN : ACR1_SYNCEN_Field := 16#0#;
MONO : Boolean := False;
OUTDRIV : Boolean := False;
-- unspecified
Reserved_14_15 : HAL.UInt2 := 16#0#;
SAIEN : Boolean := False;
DMAEN : Boolean := False;
-- unspecified
Reserved_18_18 : HAL.Bit := 16#0#;
NODIV : Boolean := False;
MCKDIV : ACR1_MCKDIV_Field := 16#0#;
OSR : Boolean := False;
MCKEN : Boolean := False;
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ACR1_Register use record
MODE at 0 range 0 .. 1;
PRTCFG at 0 range 2 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
DS at 0 range 5 .. 7;
LSBFIRST at 0 range 8 .. 8;
CKSTR at 0 range 9 .. 9;
SYNCEN at 0 range 10 .. 11;
MONO at 0 range 12 .. 12;
OUTDRIV at 0 range 13 .. 13;
Reserved_14_15 at 0 range 14 .. 15;
SAIEN at 0 range 16 .. 16;
DMAEN at 0 range 17 .. 17;
Reserved_18_18 at 0 range 18 .. 18;
NODIV at 0 range 19 .. 19;
MCKDIV at 0 range 20 .. 25;
OSR at 0 range 26 .. 26;
MCKEN at 0 range 27 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
subtype ACR2_FTH_Field is HAL.UInt3;
subtype ACR2_MUTECN_Field is HAL.UInt6;
subtype ACR2_COMP_Field is HAL.UInt2;
type ACR2_Register is record
FTH : ACR2_FTH_Field := 16#0#;
FFLUS : Boolean := False;
TRIS : Boolean := False;
MUTE : Boolean := False;
MUTE_VAL : Boolean := False;
MUTECN : ACR2_MUTECN_Field := 16#0#;
CPL : Boolean := False;
COMP : ACR2_COMP_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ACR2_Register use record
FTH at 0 range 0 .. 2;
FFLUS at 0 range 3 .. 3;
TRIS at 0 range 4 .. 4;
MUTE at 0 range 5 .. 5;
MUTE_VAL at 0 range 6 .. 6;
MUTECN at 0 range 7 .. 12;
CPL at 0 range 13 .. 13;
COMP at 0 range 14 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype AFRCR_FRL_Field is HAL.UInt8;
subtype AFRCR_FSALL_Field is HAL.UInt7;
type AFRCR_Register is record
FRL : AFRCR_FRL_Field := 16#0#;
FSALL : AFRCR_FSALL_Field := 16#0#;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
FSDEF : Boolean := False;
FSPOL : Boolean := False;
FSOFF : Boolean := False;
-- unspecified
Reserved_19_31 : HAL.UInt13 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AFRCR_Register use record
FRL at 0 range 0 .. 7;
FSALL at 0 range 8 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
FSDEF at 0 range 16 .. 16;
FSPOL at 0 range 17 .. 17;
FSOFF at 0 range 18 .. 18;
Reserved_19_31 at 0 range 19 .. 31;
end record;
subtype ASLOTR_FBOFF_Field is HAL.UInt5;
subtype ASLOTR_SLOTSZ_Field is HAL.UInt2;
subtype ASLOTR_NBSLOT_Field is HAL.UInt4;
subtype ASLOTR_SLOTEN_Field is HAL.UInt16;
type ASLOTR_Register is record
FBOFF : ASLOTR_FBOFF_Field := 16#0#;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
SLOTSZ : ASLOTR_SLOTSZ_Field := 16#0#;
NBSLOT : ASLOTR_NBSLOT_Field := 16#0#;
-- unspecified
Reserved_12_15 : HAL.UInt4 := 16#0#;
SLOTEN : ASLOTR_SLOTEN_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ASLOTR_Register use record
FBOFF at 0 range 0 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
SLOTSZ at 0 range 6 .. 7;
NBSLOT at 0 range 8 .. 11;
Reserved_12_15 at 0 range 12 .. 15;
SLOTEN at 0 range 16 .. 31;
end record;
type AIM_Register is record
OVRUDRIE : Boolean := False;
MUTEDETIE : Boolean := False;
WCKCFGIE : Boolean := False;
FREQIE : Boolean := False;
CNRDYIE : Boolean := False;
AFSDETIE : Boolean := False;
LFSDETIE : Boolean := False;
-- unspecified
Reserved_7_31 : HAL.UInt25 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AIM_Register use record
OVRUDRIE at 0 range 0 .. 0;
MUTEDETIE at 0 range 1 .. 1;
WCKCFGIE at 0 range 2 .. 2;
FREQIE at 0 range 3 .. 3;
CNRDYIE at 0 range 4 .. 4;
AFSDETIE at 0 range 5 .. 5;
LFSDETIE at 0 range 6 .. 6;
Reserved_7_31 at 0 range 7 .. 31;
end record;
subtype ASR_FLVL_Field is HAL.UInt3;
type ASR_Register is record
OVRUDR : Boolean := False;
MUTEDET : Boolean := False;
WCKCFG : Boolean := False;
FREQ : Boolean := False;
CNRDY : Boolean := False;
AFSDET : Boolean := False;
LFSDET : Boolean := False;
-- unspecified
Reserved_7_15 : HAL.UInt9 := 16#0#;
FLVL : ASR_FLVL_Field := 16#0#;
-- unspecified
Reserved_19_31 : HAL.UInt13 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ASR_Register use record
OVRUDR at 0 range 0 .. 0;
MUTEDET at 0 range 1 .. 1;
WCKCFG at 0 range 2 .. 2;
FREQ at 0 range 3 .. 3;
CNRDY at 0 range 4 .. 4;
AFSDET at 0 range 5 .. 5;
LFSDET at 0 range 6 .. 6;
Reserved_7_15 at 0 range 7 .. 15;
FLVL at 0 range 16 .. 18;
Reserved_19_31 at 0 range 19 .. 31;
end record;
type ACLRFR_Register is record
COVRUDR : Boolean := False;
CMUTEDET : Boolean := False;
CWCKCFG : Boolean := False;
-- unspecified
Reserved_3_3 : HAL.Bit := 16#0#;
CCNRDY : Boolean := False;
CAFSDET : Boolean := False;
CLFSDET : Boolean := False;
-- unspecified
Reserved_7_31 : HAL.UInt25 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ACLRFR_Register use record
COVRUDR at 0 range 0 .. 0;
CMUTEDET at 0 range 1 .. 1;
CWCKCFG at 0 range 2 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
CCNRDY at 0 range 4 .. 4;
CAFSDET at 0 range 5 .. 5;
CLFSDET at 0 range 6 .. 6;
Reserved_7_31 at 0 range 7 .. 31;
end record;
subtype BCR1_MODE_Field is HAL.UInt2;
subtype BCR1_PRTCFG_Field is HAL.UInt2;
subtype BCR1_DS_Field is HAL.UInt3;
subtype BCR1_SYNCEN_Field is HAL.UInt2;
subtype BCR1_MCKDIV_Field is HAL.UInt6;
type BCR1_Register is record
MODE : BCR1_MODE_Field := 16#0#;
PRTCFG : BCR1_PRTCFG_Field := 16#0#;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
DS : BCR1_DS_Field := 16#0#;
LSBFIRST : Boolean := False;
CKSTR : Boolean := False;
SYNCEN : BCR1_SYNCEN_Field := 16#0#;
MONO : Boolean := False;
OUTDRIV : Boolean := False;
-- unspecified
Reserved_14_15 : HAL.UInt2 := 16#0#;
SAIEN : Boolean := False;
DMAEN : Boolean := False;
-- unspecified
Reserved_18_18 : HAL.Bit := 16#0#;
NODIV : Boolean := False;
MCKDIV : BCR1_MCKDIV_Field := 16#0#;
OSR : Boolean := False;
MCKEN : Boolean := False;
-- unspecified
Reserved_28_31 : HAL.UInt4 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BCR1_Register use record
MODE at 0 range 0 .. 1;
PRTCFG at 0 range 2 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
DS at 0 range 5 .. 7;
LSBFIRST at 0 range 8 .. 8;
CKSTR at 0 range 9 .. 9;
SYNCEN at 0 range 10 .. 11;
MONO at 0 range 12 .. 12;
OUTDRIV at 0 range 13 .. 13;
Reserved_14_15 at 0 range 14 .. 15;
SAIEN at 0 range 16 .. 16;
DMAEN at 0 range 17 .. 17;
Reserved_18_18 at 0 range 18 .. 18;
NODIV at 0 range 19 .. 19;
MCKDIV at 0 range 20 .. 25;
OSR at 0 range 26 .. 26;
MCKEN at 0 range 27 .. 27;
Reserved_28_31 at 0 range 28 .. 31;
end record;
subtype BCR2_FTH_Field is HAL.UInt3;
subtype BCR2_MUTECN_Field is HAL.UInt6;
subtype BCR2_COMP_Field is HAL.UInt2;
type BCR2_Register is record
FTH : BCR2_FTH_Field := 16#0#;
FFLUS : Boolean := False;
TRIS : Boolean := False;
MUTE : Boolean := False;
MUTE_VAL : Boolean := False;
MUTECN : BCR2_MUTECN_Field := 16#0#;
CPL : Boolean := False;
COMP : BCR2_COMP_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BCR2_Register use record
FTH at 0 range 0 .. 2;
FFLUS at 0 range 3 .. 3;
TRIS at 0 range 4 .. 4;
MUTE at 0 range 5 .. 5;
MUTE_VAL at 0 range 6 .. 6;
MUTECN at 0 range 7 .. 12;
CPL at 0 range 13 .. 13;
COMP at 0 range 14 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype BFRCR_FRL_Field is HAL.UInt8;
subtype BFRCR_FSALL_Field is HAL.UInt7;
type BFRCR_Register is record
FRL : BFRCR_FRL_Field := 16#0#;
FSALL : BFRCR_FSALL_Field := 16#0#;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
FSDEF : Boolean := False;
FSPOL : Boolean := False;
FSOFF : Boolean := False;
-- unspecified
Reserved_19_31 : HAL.UInt13 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BFRCR_Register use record
FRL at 0 range 0 .. 7;
FSALL at 0 range 8 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
FSDEF at 0 range 16 .. 16;
FSPOL at 0 range 17 .. 17;
FSOFF at 0 range 18 .. 18;
Reserved_19_31 at 0 range 19 .. 31;
end record;
subtype BSLOTR_FBOFF_Field is HAL.UInt5;
subtype BSLOTR_SLOTSZ_Field is HAL.UInt2;
subtype BSLOTR_NBSLOT_Field is HAL.UInt4;
subtype BSLOTR_SLOTEN_Field is HAL.UInt16;
type BSLOTR_Register is record
FBOFF : BSLOTR_FBOFF_Field := 16#0#;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
SLOTSZ : BSLOTR_SLOTSZ_Field := 16#0#;
NBSLOT : BSLOTR_NBSLOT_Field := 16#0#;
-- unspecified
Reserved_12_15 : HAL.UInt4 := 16#0#;
SLOTEN : BSLOTR_SLOTEN_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BSLOTR_Register use record
FBOFF at 0 range 0 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
SLOTSZ at 0 range 6 .. 7;
NBSLOT at 0 range 8 .. 11;
Reserved_12_15 at 0 range 12 .. 15;
SLOTEN at 0 range 16 .. 31;
end record;
type BIM_Register is record
OVRUDRIE : Boolean := False;
MUTEDETIE : Boolean := False;
WCKCFGIE : Boolean := False;
FREQIE : Boolean := False;
CNRDYIE : Boolean := False;
AFSDETIE : Boolean := False;
LFSDETIE : Boolean := False;
-- unspecified
Reserved_7_31 : HAL.UInt25 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BIM_Register use record
OVRUDRIE at 0 range 0 .. 0;
MUTEDETIE at 0 range 1 .. 1;
WCKCFGIE at 0 range 2 .. 2;
FREQIE at 0 range 3 .. 3;
CNRDYIE at 0 range 4 .. 4;
AFSDETIE at 0 range 5 .. 5;
LFSDETIE at 0 range 6 .. 6;
Reserved_7_31 at 0 range 7 .. 31;
end record;
subtype BSR_FLVL_Field is HAL.UInt3;
type BSR_Register is record
OVRUDR : Boolean := False;
MUTEDET : Boolean := False;
WCKCFG : Boolean := False;
FREQ : Boolean := False;
CNRDY : Boolean := False;
AFSDET : Boolean := False;
LFSDET : Boolean := False;
-- unspecified
Reserved_7_15 : HAL.UInt9 := 16#0#;
FLVL : BSR_FLVL_Field := 16#0#;
-- unspecified
Reserved_19_31 : HAL.UInt13 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BSR_Register use record
OVRUDR at 0 range 0 .. 0;
MUTEDET at 0 range 1 .. 1;
WCKCFG at 0 range 2 .. 2;
FREQ at 0 range 3 .. 3;
CNRDY at 0 range 4 .. 4;
AFSDET at 0 range 5 .. 5;
LFSDET at 0 range 6 .. 6;
Reserved_7_15 at 0 range 7 .. 15;
FLVL at 0 range 16 .. 18;
Reserved_19_31 at 0 range 19 .. 31;
end record;
type BCLRFR_Register is record
COVRUDR : Boolean := False;
CMUTEDET : Boolean := False;
CWCKCFG : Boolean := False;
-- unspecified
Reserved_3_3 : HAL.Bit := 16#0#;
CCNRDY : Boolean := False;
CAFSDET : Boolean := False;
CLFSDET : Boolean := False;
-- unspecified
Reserved_7_31 : HAL.UInt25 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for BCLRFR_Register use record
COVRUDR at 0 range 0 .. 0;
CMUTEDET at 0 range 1 .. 1;
CWCKCFG at 0 range 2 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
CCNRDY at 0 range 4 .. 4;
CAFSDET at 0 range 5 .. 5;
CLFSDET at 0 range 6 .. 6;
Reserved_7_31 at 0 range 7 .. 31;
end record;
subtype PDMCR_MICNBR_Field is HAL.UInt2;
-- PDMCR_CKEN array
type PDMCR_CKEN_Field_Array is array (1 .. 2) of Boolean
with Component_Size => 1, Size => 2;
-- Type definition for PDMCR_CKEN
type PDMCR_CKEN_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- CKEN as a value
Val : HAL.UInt2;
when True =>
-- CKEN as an array
Arr : PDMCR_CKEN_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for PDMCR_CKEN_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
type PDMCR_Register is record
PDMEN : Boolean := False;
-- unspecified
Reserved_1_3 : HAL.UInt3 := 16#0#;
MICNBR : PDMCR_MICNBR_Field := 16#0#;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
CKEN : PDMCR_CKEN_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_10_31 : HAL.UInt22 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for PDMCR_Register use record
PDMEN at 0 range 0 .. 0;
Reserved_1_3 at 0 range 1 .. 3;
MICNBR at 0 range 4 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
CKEN at 0 range 8 .. 9;
Reserved_10_31 at 0 range 10 .. 31;
end record;
subtype PDMDLY_DLYM1L_Field is HAL.UInt3;
subtype PDMDLY_DLYM1R_Field is HAL.UInt3;
subtype PDMDLY_DLYM2L_Field is HAL.UInt3;
subtype PDMDLY_DLYM2R_Field is HAL.UInt3;
subtype PDMDLY_DLYM3L_Field is HAL.UInt3;
subtype PDMDLY_DLYM3R_Field is HAL.UInt3;
subtype PDMDLY_DLYM4L_Field is HAL.UInt3;
subtype PDMDLY_DLYM4R_Field is HAL.UInt3;
type PDMDLY_Register is record
DLYM1L : PDMDLY_DLYM1L_Field := 16#0#;
-- unspecified
Reserved_3_3 : HAL.Bit := 16#0#;
DLYM1R : PDMDLY_DLYM1R_Field := 16#0#;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
DLYM2L : PDMDLY_DLYM2L_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
DLYM2R : PDMDLY_DLYM2R_Field := 16#0#;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
DLYM3L : PDMDLY_DLYM3L_Field := 16#0#;
-- unspecified
Reserved_19_19 : HAL.Bit := 16#0#;
DLYM3R : PDMDLY_DLYM3R_Field := 16#0#;
-- unspecified
Reserved_23_23 : HAL.Bit := 16#0#;
DLYM4L : PDMDLY_DLYM4L_Field := 16#0#;
-- unspecified
Reserved_27_27 : HAL.Bit := 16#0#;
DLYM4R : PDMDLY_DLYM4R_Field := 16#0#;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for PDMDLY_Register use record
DLYM1L at 0 range 0 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
DLYM1R at 0 range 4 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
DLYM2L at 0 range 8 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
DLYM2R at 0 range 12 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
DLYM3L at 0 range 16 .. 18;
Reserved_19_19 at 0 range 19 .. 19;
DLYM3R at 0 range 20 .. 22;
Reserved_23_23 at 0 range 23 .. 23;
DLYM4L at 0 range 24 .. 26;
Reserved_27_27 at 0 range 27 .. 27;
DLYM4R at 0 range 28 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
type SAI_Peripheral is record
ACR1 : aliased ACR1_Register;
ACR2 : aliased ACR2_Register;
AFRCR : aliased AFRCR_Register;
ASLOTR : aliased ASLOTR_Register;
AIM : aliased AIM_Register;
ASR : aliased ASR_Register;
ACLRFR : aliased ACLRFR_Register;
ADR : aliased HAL.UInt32;
BCR1 : aliased BCR1_Register;
BCR2 : aliased BCR2_Register;
BFRCR : aliased BFRCR_Register;
BSLOTR : aliased BSLOTR_Register;
BIM : aliased BIM_Register;
BSR : aliased BSR_Register;
BCLRFR : aliased BCLRFR_Register;
BDR : aliased HAL.UInt32;
PDMCR : aliased PDMCR_Register;
PDMDLY : aliased PDMDLY_Register;
end record
with Volatile;
for SAI_Peripheral use record
ACR1 at 16#4# range 0 .. 31;
ACR2 at 16#8# range 0 .. 31;
AFRCR at 16#C# range 0 .. 31;
ASLOTR at 16#10# range 0 .. 31;
AIM at 16#14# range 0 .. 31;
ASR at 16#18# range 0 .. 31;
ACLRFR at 16#1C# range 0 .. 31;
ADR at 16#20# range 0 .. 31;
BCR1 at 16#24# range 0 .. 31;
BCR2 at 16#28# range 0 .. 31;
BFRCR at 16#2C# range 0 .. 31;
BSLOTR at 16#30# range 0 .. 31;
BIM at 16#34# range 0 .. 31;
BSR at 16#38# range 0 .. 31;
BCLRFR at 16#3C# range 0 .. 31;
BDR at 16#40# range 0 .. 31;
PDMCR at 16#44# range 0 .. 31;
PDMDLY at 16#48# range 0 .. 31;
end record;
SAI_Periph : aliased SAI_Peripheral
with Import, Address => System'To_Address (16#40015400#);
end STM32_SVD.SAI;
|
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Curses_Demo --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright 2020 Thomas E. Dickey --
-- Copyright 1998-2002,2003 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Sample.Curses_Demo is
procedure Demo;
end Sample.Curses_Demo;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T D L L --
-- --
-- B o d y --
-- --
-- $Revision$
-- --
-- Copyright (C) 1997-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. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- GNATDLL is a Windows specific tool for building a DLL.
-- Both relocatable and non-relocatable DLL's are supported
with Ada.Text_IO;
with Ada.Strings.Unbounded;
with Ada.Exceptions;
with Ada.Command_Line;
with GNAT.OS_Lib;
with GNAT.Command_Line;
with Gnatvsn;
with MDLL.Files;
with MDLL.Tools;
procedure Gnatdll is
use GNAT;
use Ada;
use MDLL;
use Ada.Strings.Unbounded;
use type OS_Lib.Argument_List;
procedure Syntax;
-- Print out usage
procedure Check (Filename : String);
-- Check that the file whose name is Filename exists
procedure Parse_Command_Line;
-- Parse the command line arguments passed to gnatdll
procedure Check_Context;
-- Check the context before runing any commands to build the library
Syntax_Error : exception;
Context_Error : exception;
-- What are these for ???
Help : Boolean := False;
-- What is this for ???
Version : constant String := Gnatvsn.Gnat_Version_String;
-- Why should it be necessary to make a copy of this
Default_DLL_Address : constant String := "0x11000000";
-- Default address for non relocatable DLL (Win32)
Lib_Filename : Unbounded_String := Null_Unbounded_String;
Def_Filename : Unbounded_String := Null_Unbounded_String;
List_Filename : Unbounded_String := Null_Unbounded_String;
DLL_Address : Unbounded_String :=
To_Unbounded_String (Default_DLL_Address);
-- What are the above ???
Objects_Files : Argument_List_Access := Null_Argument_List_Access;
-- List of objects to put inside the library
Ali_Files : Argument_List_Access := Null_Argument_List_Access;
-- For each Ada file specified, we keep arecord of the corresponding
-- ALI file. This list of SLI files is used to build the binder program.
Options : Argument_List_Access := Null_Argument_List_Access;
-- A list of options set in the command line.
Largs_Options : Argument_List_Access := Null_Argument_List_Access;
Bargs_Options : Argument_List_Access := Null_Argument_List_Access;
-- GNAT linker and binder args options
type Build_Mode_State is (Import_Lib, Dynamic_Lib, Nil);
-- Comments needed ???
Build_Mode : Build_Mode_State := Nil;
Must_Build_Relocatable : Boolean := True;
Build_Import : Boolean := True;
-- Comments needed
------------
-- Syntax --
------------
procedure Syntax is
use Text_IO;
procedure P (Str : in String) renames Text_IO.Put_Line;
begin
P ("Usage : gnatdll [options] [list-of-files]");
New_Line;
P ("[list-of-files] a list of Ada libraries (.ali) and/or " &
"foreign object files");
New_Line;
P ("[options] can be");
P (" -h Help - display this message");
P (" -v Verbose");
P (" -q Quiet");
P (" -k Remove @nn suffix from exported names");
P (" -g Generate debugging information");
P (" -Idir Specify source and object files search path");
P (" -l file File contains a list-of-files to be added to "
& "the library");
P (" -e file Definition file containing exports");
P (" -d file Put objects in the relocatable dynamic "
& "library <file>");
P (" -a[addr] Build non-relocatable DLL at address <addr>");
P (" if <addr> is not specified use "
& Default_DLL_Address);
P (" -n No-import - do not create the import library");
P (" -bargs opts opts are passed to the binder");
P (" -largs opts opts are passed to the linker");
end Syntax;
-----------
-- Check --
-----------
procedure Check (Filename : in String) is
begin
if not OS_Lib.Is_Regular_File (Filename) then
Exceptions.Raise_Exception (Context_Error'Identity,
"Error: " & Filename & " not found.");
end if;
end Check;
------------------------
-- Parse_Command_Line --
------------------------
procedure Parse_Command_Line is
use GNAT.Command_Line;
procedure Add_File (Filename : in String);
-- add one file to the list of file to handle
procedure Add_Files_From_List (List_Filename : in String);
-- add the files listed in List_Filename (one by line) to the list
-- of file to handle
procedure Ali_To_Object_List;
-- for each ali file in Afiles set put a corresponding object file in
-- Ofiles set.
Max_Files : constant := 5_000;
Max_Options : constant := 100;
-- These are arbitrary limits, a better way will be to use linked list.
-- No, a better choice would be to use tables ???
-- Limits on what???
Ofiles : OS_Lib.Argument_List (1 .. Max_Files);
O : Positive := Ofiles'First;
-- List of object files to put in the library. O is the next entry
-- to be used.
Afiles : OS_Lib.Argument_List (1 .. Max_Files);
A : Positive := Afiles'First;
-- List of ALI files. A is the next entry to be used.
Gopts : OS_Lib.Argument_List (1 .. Max_Options);
G : Positive := Gopts'First;
-- List of gcc options. G is the next entry to be used.
Lopts : OS_Lib.Argument_List (1 .. Max_Options);
L : Positive := Lopts'First;
-- A list of -largs options (L is next entry to be used)
Bopts : OS_Lib.Argument_List (1 .. Max_Options);
B : Positive := Bopts'First;
-- A list of -bargs options (B is next entry to be used)
--------------
-- Add_File --
--------------
procedure Add_File (Filename : in String) is
begin
-- others files are to be put inside the dynamic library
-- ??? this makes no sense, should it be "Other files ..."
if Files.Is_Ali (Filename) then
Check (Filename);
-- Record it to generate the binder program when
-- building dynamic library
Afiles (A) := new String'(Filename);
A := A + 1;
elsif Files.Is_Obj (Filename) then
Check (Filename);
-- Just record this object file
Ofiles (O) := new String'(Filename);
O := O + 1;
else
-- Unknown file type
Exceptions.Raise_Exception
(Syntax_Error'Identity,
"don't know what to do with " & Filename & " !");
end if;
end Add_File;
-------------------------
-- Add_Files_From_List --
-------------------------
procedure Add_Files_From_List (List_Filename : in String) is
File : Text_IO.File_Type;
Buffer : String (1 .. 500);
Last : Natural;
begin
Text_IO.Open (File, Text_IO.In_File, List_Filename);
while not Text_IO.End_Of_File (File) loop
Text_IO.Get_Line (File, Buffer, Last);
Add_File (Buffer (1 .. Last));
end loop;
Text_IO.Close (File);
end Add_Files_From_List;
------------------------
-- Ali_To_Object_List --
------------------------
procedure Ali_To_Object_List is
begin
for K in 1 .. A - 1 loop
Ofiles (O) := new String'(Files.Ext_To (Afiles (K).all, "o"));
O := O + 1;
end loop;
end Ali_To_Object_List;
-- Start of processing for Parse_Command_Line
begin
Initialize_Option_Scan ('-', False, "bargs largs");
-- scan gnatdll switches
loop
case Getopt ("g h v q k a? d: e: l: n I:") is
when ASCII.Nul =>
exit;
when 'h' =>
Help := True;
when 'g' =>
Gopts (G) := new String'("-g");
G := G + 1;
when 'v' =>
-- Turn verbose mode on
MDLL.Verbose := True;
if MDLL.Quiet then
Exceptions.Raise_Exception
(Syntax_Error'Identity,
"impossible to use -q and -v together.");
end if;
when 'q' =>
-- Turn quiet mode on
MDLL.Quiet := True;
if MDLL.Verbose then
Exceptions.Raise_Exception
(Syntax_Error'Identity,
"impossible to use -v and -q together.");
end if;
when 'k' =>
MDLL.Kill_Suffix := True;
when 'a' =>
if Parameter = "" then
-- Default address for a relocatable dynamic library.
-- address for a non relocatable dynamic library.
DLL_Address := To_Unbounded_String (Default_DLL_Address);
else
DLL_Address := To_Unbounded_String (Parameter);
end if;
Must_Build_Relocatable := False;
when 'e' =>
Def_Filename := To_Unbounded_String (Parameter);
when 'd' =>
-- Build a non relocatable DLL
Lib_Filename := To_Unbounded_String (Parameter);
if Def_Filename = Null_Unbounded_String then
Def_Filename := To_Unbounded_String
(Files.Ext_To (Parameter, "def"));
end if;
Build_Mode := Dynamic_Lib;
when 'n' =>
Build_Import := False;
when 'l' =>
List_Filename := To_Unbounded_String (Parameter);
when 'I' =>
Gopts (G) := new String'("-I" & Parameter);
G := G + 1;
when others =>
raise Invalid_Switch;
end case;
end loop;
-- Get parameters
loop
declare
File : constant String := Get_Argument (Do_Expansion => True);
begin
exit when File'Length = 0;
Add_File (File);
end;
end loop;
-- Get largs parameters
Goto_Section ("largs");
loop
case Getopt ("*") is
when ASCII.Nul =>
exit;
when others =>
Lopts (L) := new String'(Full_Switch);
L := L + 1;
end case;
end loop;
-- Get bargs parameters
Goto_Section ("bargs");
loop
case Getopt ("*") is
when ASCII.Nul =>
exit;
when others =>
Bopts (B) := new String'(Full_Switch);
B := B + 1;
end case;
end loop;
-- if list filename has been specified, parse it
if List_Filename /= Null_Unbounded_String then
Add_Files_From_List (To_String (List_Filename));
end if;
-- Check if the set of parameters are compatible.
if Build_Mode = Nil and then not Help and then not Verbose then
Exceptions.Raise_Exception
(Syntax_Error'Identity,
"nothing to do.");
end if;
-- Check if we want to build an import library (option -e and
-- no file specified)
if Build_Mode = Dynamic_Lib
and then A = Afiles'First
and then O = Ofiles'First
then
Build_Mode := Import_Lib;
end if;
if O /= Ofiles'First then
Objects_Files := new OS_Lib.Argument_List'(Ofiles (1 .. O - 1));
end if;
if A /= Afiles'First then
Ali_Files := new OS_Lib.Argument_List'(Afiles (1 .. A - 1));
end if;
if G /= Gopts'First then
Options := new OS_Lib.Argument_List'(Gopts (1 .. G - 1));
end if;
if L /= Lopts'First then
Largs_Options := new OS_Lib.Argument_List'(Lopts (1 .. L - 1));
end if;
if B /= Bopts'First then
Bargs_Options := new OS_Lib.Argument_List'(Bopts (1 .. B - 1));
end if;
exception
when Invalid_Switch =>
Exceptions.Raise_Exception
(Syntax_Error'Identity,
Message => "Invalid Switch " & Full_Switch);
when Invalid_Parameter =>
Exceptions.Raise_Exception
(Syntax_Error'Identity,
Message => "No parameter for " & Full_Switch);
end Parse_Command_Line;
-------------------
-- Check_Context --
-------------------
procedure Check_Context is
begin
Check (To_String (Def_Filename));
-- Check that each object file specified exists and raise exception
-- Context_Error if it does not.
for F in Objects_Files'Range loop
Check (Objects_Files (F).all);
end loop;
end Check_Context;
-- Start of processing for Gnatdll
begin
if Ada.Command_Line.Argument_Count = 0 then
Help := True;
else
Parse_Command_Line;
end if;
if MDLL.Verbose or else Help then
Text_IO.New_Line;
Text_IO.Put_Line ("GNATDLL " & Version & " - Dynamic Libraries Builder");
Text_IO.New_Line;
end if;
MDLL.Tools.Locate;
if Help
or else (MDLL.Verbose and then Ada.Command_Line.Argument_Count = 1)
then
Syntax;
else
Check_Context;
case Build_Mode is
when Import_Lib =>
MDLL.Build_Import_Library
(To_String (Lib_Filename),
To_String (Def_Filename));
when Dynamic_Lib =>
MDLL.Build_Dynamic_Library
(Objects_Files.all,
Ali_Files.all,
Options.all,
Bargs_Options.all,
Largs_Options.all,
To_String (Lib_Filename),
To_String (Def_Filename),
To_String (DLL_Address),
Build_Import,
Must_Build_Relocatable);
when Nil =>
null;
end case;
end if;
Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Success);
exception
when SE : Syntax_Error =>
Text_IO.Put_Line ("Syntax error : " & Exceptions.Exception_Message (SE));
Text_IO.New_Line;
Syntax;
Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
when E : Tools_Error | Context_Error =>
Text_IO.Put_Line (Exceptions.Exception_Message (E));
Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
when others =>
Text_IO.Put_Line ("gnatdll: INTERNAL ERROR. Please report");
Ada.Command_Line.Set_Exit_Status (Ada.Command_Line.Failure);
end Gnatdll;
|
package Factions.Test_Data.Tests.Careers_Container is
end Factions.Test_Data.Tests.Careers_Container;
|
-- Copyright 2014-2016 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
type Packed_Array is array (Natural range <>) of Boolean;
pragma Pack (Packed_Array);
function Make (H, L : Natural) return Packed_Array;
procedure Do_Nothing (A : System.Address);
end Pck;
|
with Sodium.Functions; use Sodium.Functions;
with Ada.Text_IO; use Ada.Text_IO;
procedure Demo_Ada
is
message : constant String := "Arbitrary text to hash";
key : constant String := "123456789 123456789 123456789 12";
begin
if not initialize_sodium_library then
Put_Line ("Initialization failed");
return;
end if;
declare
hash : constant String := Keyless_Hash (message);
minhash : constant String := Keyless_Hash (message, Hash_Size_Range'First);
maxhash : constant String := Keyless_Hash (message, Hash_Size_Range'Last);
keyhash : constant String := Keyed_Hash (message, key);
keyhmin : constant String := Keyed_Hash (message, key, Hash_Size_Range'First);
keyhmax : constant String := Keyed_Hash (message, key, Hash_Size_Range'Last);
begin
Put_Line ("text: " & message);
Put_Line ("min hash: " & As_Hexidecimal (minhash));
Put_Line ("hash length is" & minhash'Length'Img);
Put_Line ("");
Put_Line ("std hash: " & As_Hexidecimal (hash));
Put_Line ("hash length is" & hash'Length'Img);
Put_Line ("");
Put_Line ("max hash: " & As_Hexidecimal (maxhash));
Put_Line ("hash length is" & maxhash'Length'Img);
Put_Line ("");
Put_Line ("keyed min hash: " & As_Hexidecimal (keyhmin));
Put_Line ("keyed std hash: " & As_Hexidecimal (keyhash));
Put_Line ("keyed max hash: " & As_Hexidecimal (keyhmax));
end;
end Demo_Ada;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- E X P _ C H 6 --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Atree; use Atree;
with Checks; use Checks;
with Debug; use Debug;
with Einfo; use Einfo;
with Errout; use Errout;
with Elists; use Elists;
with Exp_Ch2; use Exp_Ch2;
with Exp_Ch3; use Exp_Ch3;
with Exp_Ch7; use Exp_Ch7;
with Exp_Ch9; use Exp_Ch9;
with Exp_Dbug; use Exp_Dbug;
with Exp_Disp; use Exp_Disp;
with Exp_Dist; use Exp_Dist;
with Exp_Intr; use Exp_Intr;
with Exp_Pakd; use Exp_Pakd;
with Exp_Tss; use Exp_Tss;
with Exp_Util; use Exp_Util;
with Fname; use Fname;
with Freeze; use Freeze;
with Hostparm; use Hostparm;
with Inline; use Inline;
with Lib; use Lib;
with Nlists; use Nlists;
with Nmake; use Nmake;
with Opt; use Opt;
with Restrict; use Restrict;
with Rident; use Rident;
with Rtsfind; use Rtsfind;
with Sem; use Sem;
with Sem_Ch6; use Sem_Ch6;
with Sem_Ch8; use Sem_Ch8;
with Sem_Ch12; use Sem_Ch12;
with Sem_Ch13; use Sem_Ch13;
with Sem_Disp; use Sem_Disp;
with Sem_Dist; use Sem_Dist;
with Sem_Mech; use Sem_Mech;
with Sem_Res; use Sem_Res;
with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Snames; use Snames;
with Stand; use Stand;
with Tbuild; use Tbuild;
with Ttypes; use Ttypes;
with Uintp; use Uintp;
with Validsw; use Validsw;
package body Exp_Ch6 is
-----------------------
-- Local Subprograms --
-----------------------
procedure Check_Overriding_Operation (Subp : Entity_Id);
-- Subp is a dispatching operation. Check whether it may override an
-- inherited private operation, in which case its DT entry is that of
-- the hidden operation, not the one it may have received earlier.
-- This must be done before emitting the code to set the corresponding
-- DT to the address of the subprogram. The actual placement of Subp in
-- the proper place in the list of primitive operations is done in
-- Declare_Inherited_Private_Subprograms, which also has to deal with
-- implicit operations. This duplication is unavoidable for now???
procedure Detect_Infinite_Recursion (N : Node_Id; Spec : Entity_Id);
-- This procedure is called only if the subprogram body N, whose spec
-- has the given entity Spec, contains a parameterless recursive call.
-- It attempts to generate runtime code to detect if this a case of
-- infinite recursion.
--
-- The body is scanned to determine dependencies. If the only external
-- dependencies are on a small set of scalar variables, then the values
-- of these variables are captured on entry to the subprogram, and if
-- the values are not changed for the call, we know immediately that
-- we have an infinite recursion.
procedure Expand_Actuals (N : Node_Id; Subp : Entity_Id);
-- For each actual of an in-out or out parameter which is a numeric
-- (view) conversion of the form T (A), where A denotes a variable,
-- we insert the declaration:
--
-- Temp : T[ := T (A)];
--
-- prior to the call. Then we replace the actual with a reference to Temp,
-- and append the assignment:
--
-- A := TypeA (Temp);
--
-- after the call. Here TypeA is the actual type of variable A.
-- For out parameters, the initial declaration has no expression.
-- If A is not an entity name, we generate instead:
--
-- Var : TypeA renames A;
-- Temp : T := Var; -- omitting expression for out parameter.
-- ...
-- Var := TypeA (Temp);
--
-- For other in-out parameters, we emit the required constraint checks
-- before and/or after the call.
--
-- For all parameter modes, actuals that denote components and slices
-- of packed arrays are expanded into suitable temporaries.
--
-- For non-scalar objects that are possibly unaligned, add call by copy
-- code (copy in for IN and IN OUT, copy out for OUT and IN OUT).
procedure Expand_Inlined_Call
(N : Node_Id;
Subp : Entity_Id;
Orig_Subp : Entity_Id);
-- If called subprogram can be inlined by the front-end, retrieve the
-- analyzed body, replace formals with actuals and expand call in place.
-- Generate thunks for actuals that are expressions, and insert the
-- corresponding constant declarations before the call. If the original
-- call is to a derived operation, the return type is the one of the
-- derived operation, but the body is that of the original, so return
-- expressions in the body must be converted to the desired type (which
-- is simply not noted in the tree without inline expansion).
function Expand_Protected_Object_Reference
(N : Node_Id;
Scop : Entity_Id)
return Node_Id;
procedure Expand_Protected_Subprogram_Call
(N : Node_Id;
Subp : Entity_Id;
Scop : Entity_Id);
-- A call to a protected subprogram within the protected object may appear
-- as a regular call. The list of actuals must be expanded to contain a
-- reference to the object itself, and the call becomes a call to the
-- corresponding protected subprogram.
--------------------------------
-- Check_Overriding_Operation --
--------------------------------
procedure Check_Overriding_Operation (Subp : Entity_Id) is
Typ : constant Entity_Id := Find_Dispatching_Type (Subp);
Op_List : constant Elist_Id := Primitive_Operations (Typ);
Op_Elmt : Elmt_Id;
Prim_Op : Entity_Id;
Par_Op : Entity_Id;
begin
if Is_Derived_Type (Typ)
and then not Is_Private_Type (Typ)
and then In_Open_Scopes (Scope (Etype (Typ)))
and then Typ = Base_Type (Typ)
then
-- Subp overrides an inherited private operation if there is an
-- inherited operation with a different name than Subp (see
-- Derive_Subprogram) whose Alias is a hidden subprogram with the
-- same name as Subp.
Op_Elmt := First_Elmt (Op_List);
while Present (Op_Elmt) loop
Prim_Op := Node (Op_Elmt);
Par_Op := Alias (Prim_Op);
if Present (Par_Op)
and then not Comes_From_Source (Prim_Op)
and then Chars (Prim_Op) /= Chars (Par_Op)
and then Chars (Par_Op) = Chars (Subp)
and then Is_Hidden (Par_Op)
and then Type_Conformant (Prim_Op, Subp)
then
Set_DT_Position (Subp, DT_Position (Prim_Op));
end if;
Next_Elmt (Op_Elmt);
end loop;
end if;
end Check_Overriding_Operation;
-------------------------------
-- Detect_Infinite_Recursion --
-------------------------------
procedure Detect_Infinite_Recursion (N : Node_Id; Spec : Entity_Id) is
Loc : constant Source_Ptr := Sloc (N);
Var_List : constant Elist_Id := New_Elmt_List;
-- List of globals referenced by body of procedure
Call_List : constant Elist_Id := New_Elmt_List;
-- List of recursive calls in body of procedure
Shad_List : constant Elist_Id := New_Elmt_List;
-- List of entity id's for entities created to capture the value of
-- referenced globals on entry to the procedure.
Scop : constant Uint := Scope_Depth (Spec);
-- This is used to record the scope depth of the current procedure, so
-- that we can identify global references.
Max_Vars : constant := 4;
-- Do not test more than four global variables
Count_Vars : Natural := 0;
-- Count variables found so far
Var : Entity_Id;
Elm : Elmt_Id;
Ent : Entity_Id;
Call : Elmt_Id;
Decl : Node_Id;
Test : Node_Id;
Elm1 : Elmt_Id;
Elm2 : Elmt_Id;
Last : Node_Id;
function Process (Nod : Node_Id) return Traverse_Result;
-- Function to traverse the subprogram body (using Traverse_Func)
-------------
-- Process --
-------------
function Process (Nod : Node_Id) return Traverse_Result is
begin
-- Procedure call
if Nkind (Nod) = N_Procedure_Call_Statement then
-- Case of one of the detected recursive calls
if Is_Entity_Name (Name (Nod))
and then Has_Recursive_Call (Entity (Name (Nod)))
and then Entity (Name (Nod)) = Spec
then
Append_Elmt (Nod, Call_List);
return Skip;
-- Any other procedure call may have side effects
else
return Abandon;
end if;
-- A call to a pure function can always be ignored
elsif Nkind (Nod) = N_Function_Call
and then Is_Entity_Name (Name (Nod))
and then Is_Pure (Entity (Name (Nod)))
then
return Skip;
-- Case of an identifier reference
elsif Nkind (Nod) = N_Identifier then
Ent := Entity (Nod);
-- If no entity, then ignore the reference
-- Not clear why this can happen. To investigate, remove this
-- test and look at the crash that occurs here in 3401-004 ???
if No (Ent) then
return Skip;
-- Ignore entities with no Scope, again not clear how this
-- can happen, to investigate, look at 4108-008 ???
elsif No (Scope (Ent)) then
return Skip;
-- Ignore the reference if not to a more global object
elsif Scope_Depth (Scope (Ent)) >= Scop then
return Skip;
-- References to types, exceptions and constants are always OK
elsif Is_Type (Ent)
or else Ekind (Ent) = E_Exception
or else Ekind (Ent) = E_Constant
then
return Skip;
-- If other than a non-volatile scalar variable, we have some
-- kind of global reference (e.g. to a function) that we cannot
-- deal with so we forget the attempt.
elsif Ekind (Ent) /= E_Variable
or else not Is_Scalar_Type (Etype (Ent))
or else Treat_As_Volatile (Ent)
then
return Abandon;
-- Otherwise we have a reference to a global scalar
else
-- Loop through global entities already detected
Elm := First_Elmt (Var_List);
loop
-- If not detected before, record this new global reference
if No (Elm) then
Count_Vars := Count_Vars + 1;
if Count_Vars <= Max_Vars then
Append_Elmt (Entity (Nod), Var_List);
else
return Abandon;
end if;
exit;
-- If recorded before, ignore
elsif Node (Elm) = Entity (Nod) then
return Skip;
-- Otherwise keep looking
else
Next_Elmt (Elm);
end if;
end loop;
return Skip;
end if;
-- For all other node kinds, recursively visit syntactic children
else
return OK;
end if;
end Process;
function Traverse_Body is new Traverse_Func;
-- Start of processing for Detect_Infinite_Recursion
begin
-- Do not attempt detection in No_Implicit_Conditional mode, since we
-- won't be able to generate the code to handle the recursion in any
-- case.
if Restriction_Active (No_Implicit_Conditionals) then
return;
end if;
-- Otherwise do traversal and quit if we get abandon signal
if Traverse_Body (N) = Abandon then
return;
-- We must have a call, since Has_Recursive_Call was set. If not just
-- ignore (this is only an error check, so if we have a funny situation,
-- due to bugs or errors, we do not want to bomb!)
elsif Is_Empty_Elmt_List (Call_List) then
return;
end if;
-- Here is the case where we detect recursion at compile time
-- Push our current scope for analyzing the declarations and code that
-- we will insert for the checking.
New_Scope (Spec);
-- This loop builds temporary variables for each of the referenced
-- globals, so that at the end of the loop the list Shad_List contains
-- these temporaries in one-to-one correspondence with the elements in
-- Var_List.
Last := Empty;
Elm := First_Elmt (Var_List);
while Present (Elm) loop
Var := Node (Elm);
Ent :=
Make_Defining_Identifier (Loc,
Chars => New_Internal_Name ('S'));
Append_Elmt (Ent, Shad_List);
-- Insert a declaration for this temporary at the start of the
-- declarations for the procedure. The temporaries are declared as
-- constant objects initialized to the current values of the
-- corresponding temporaries.
Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Ent,
Object_Definition => New_Occurrence_Of (Etype (Var), Loc),
Constant_Present => True,
Expression => New_Occurrence_Of (Var, Loc));
if No (Last) then
Prepend (Decl, Declarations (N));
else
Insert_After (Last, Decl);
end if;
Last := Decl;
Analyze (Decl);
Next_Elmt (Elm);
end loop;
-- Loop through calls
Call := First_Elmt (Call_List);
while Present (Call) loop
-- Build a predicate expression of the form
-- True
-- and then global1 = temp1
-- and then global2 = temp2
-- ...
-- This predicate determines if any of the global values
-- referenced by the procedure have changed since the
-- current call, if not an infinite recursion is assured.
Test := New_Occurrence_Of (Standard_True, Loc);
Elm1 := First_Elmt (Var_List);
Elm2 := First_Elmt (Shad_List);
while Present (Elm1) loop
Test :=
Make_And_Then (Loc,
Left_Opnd => Test,
Right_Opnd =>
Make_Op_Eq (Loc,
Left_Opnd => New_Occurrence_Of (Node (Elm1), Loc),
Right_Opnd => New_Occurrence_Of (Node (Elm2), Loc)));
Next_Elmt (Elm1);
Next_Elmt (Elm2);
end loop;
-- Now we replace the call with the sequence
-- if no-changes (see above) then
-- raise Storage_Error;
-- else
-- original-call
-- end if;
Rewrite (Node (Call),
Make_If_Statement (Loc,
Condition => Test,
Then_Statements => New_List (
Make_Raise_Storage_Error (Loc,
Reason => SE_Infinite_Recursion)),
Else_Statements => New_List (
Relocate_Node (Node (Call)))));
Analyze (Node (Call));
Next_Elmt (Call);
end loop;
-- Remove temporary scope stack entry used for analysis
Pop_Scope;
end Detect_Infinite_Recursion;
--------------------
-- Expand_Actuals --
--------------------
procedure Expand_Actuals (N : Node_Id; Subp : Entity_Id) is
Loc : constant Source_Ptr := Sloc (N);
Actual : Node_Id;
Formal : Entity_Id;
N_Node : Node_Id;
Post_Call : List_Id;
E_Formal : Entity_Id;
procedure Add_Call_By_Copy_Code;
-- For cases where the parameter must be passed by copy, this routine
-- generates a temporary variable into which the actual is copied and
-- then passes this as the parameter. For an OUT or IN OUT parameter,
-- an assignment is also generated to copy the result back. The call
-- also takes care of any constraint checks required for the type
-- conversion case (on both the way in and the way out).
procedure Add_Simple_Call_By_Copy_Code;
-- This is similar to the above, but is used in cases where we know
-- that all that is needed is to simply create a temporary and copy
-- the value in and out of the temporary.
procedure Check_Fortran_Logical;
-- A value of type Logical that is passed through a formal parameter
-- must be normalized because .TRUE. usually does not have the same
-- representation as True. We assume that .FALSE. = False = 0.
-- What about functions that return a logical type ???
function Is_Legal_Copy return Boolean;
-- Check that an actual can be copied before generating the temporary
-- to be used in the call. If the actual is of a by_reference type then
-- the program is illegal (this can only happen in the presence of
-- rep. clauses that force an incorrect alignment). If the formal is
-- a by_reference parameter imposed by a DEC pragma, emit a warning to
-- the effect that this might lead to unaligned arguments.
function Make_Var (Actual : Node_Id) return Entity_Id;
-- Returns an entity that refers to the given actual parameter,
-- Actual (not including any type conversion). If Actual is an
-- entity name, then this entity is returned unchanged, otherwise
-- a renaming is created to provide an entity for the actual.
procedure Reset_Packed_Prefix;
-- The expansion of a packed array component reference is delayed in
-- the context of a call. Now we need to complete the expansion, so we
-- unmark the analyzed bits in all prefixes.
---------------------------
-- Add_Call_By_Copy_Code --
---------------------------
procedure Add_Call_By_Copy_Code is
Expr : Node_Id;
Init : Node_Id;
Temp : Entity_Id;
Indic : Node_Id;
Var : Entity_Id;
F_Typ : constant Entity_Id := Etype (Formal);
V_Typ : Entity_Id;
Crep : Boolean;
begin
if not Is_Legal_Copy then
return;
end if;
Temp := Make_Defining_Identifier (Loc, New_Internal_Name ('T'));
-- Use formal type for temp, unless formal type is an unconstrained
-- array, in which case we don't have to worry about bounds checks,
-- and we use the actual type, since that has appropriate bounds.
if Is_Array_Type (F_Typ) and then not Is_Constrained (F_Typ) then
Indic := New_Occurrence_Of (Etype (Actual), Loc);
else
Indic := New_Occurrence_Of (Etype (Formal), Loc);
end if;
if Nkind (Actual) = N_Type_Conversion then
V_Typ := Etype (Expression (Actual));
-- If the formal is an (in-)out parameter, capture the name
-- of the variable in order to build the post-call assignment.
Var := Make_Var (Expression (Actual));
Crep := not Same_Representation
(F_Typ, Etype (Expression (Actual)));
else
V_Typ := Etype (Actual);
Var := Make_Var (Actual);
Crep := False;
end if;
-- Setup initialization for case of in out parameter, or an out
-- parameter where the formal is an unconstrained array (in the
-- latter case, we have to pass in an object with bounds).
-- If this is an out parameter, the initial copy is wasteful, so as
-- an optimization for the one-dimensional case we extract the
-- bounds of the actual and build an uninitialized temporary of the
-- right size.
if Ekind (Formal) = E_In_Out_Parameter
or else (Is_Array_Type (F_Typ) and then not Is_Constrained (F_Typ))
then
if Nkind (Actual) = N_Type_Conversion then
if Conversion_OK (Actual) then
Init := OK_Convert_To (F_Typ, New_Occurrence_Of (Var, Loc));
else
Init := Convert_To (F_Typ, New_Occurrence_Of (Var, Loc));
end if;
elsif Ekind (Formal) = E_Out_Parameter
and then Is_Array_Type (F_Typ)
and then Number_Dimensions (F_Typ) = 1
and then not Has_Non_Null_Base_Init_Proc (F_Typ)
then
-- Actual is a one-dimensional array or slice, and the type
-- requires no initialization. Create a temporary of the
-- right size, but do not copy actual into it (optimization).
Init := Empty;
Indic :=
Make_Subtype_Indication (Loc,
Subtype_Mark =>
New_Occurrence_Of (F_Typ, Loc),
Constraint =>
Make_Index_Or_Discriminant_Constraint (Loc,
Constraints => New_List (
Make_Range (Loc,
Low_Bound =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Var, Loc),
-- LLVM local
Attribute_Name => Name_First),
High_Bound =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Var, Loc),
Attribute_Name => Name_Last)))));
else
Init := New_Occurrence_Of (Var, Loc);
end if;
-- An initialization is created for packed conversions as
-- actuals for out parameters to enable Make_Object_Declaration
-- to determine the proper subtype for N_Node. Note that this
-- is wasteful because the extra copying on the call side is
-- not required for such out parameters. ???
elsif Ekind (Formal) = E_Out_Parameter
and then Nkind (Actual) = N_Type_Conversion
and then (Is_Bit_Packed_Array (F_Typ)
or else
Is_Bit_Packed_Array (Etype (Expression (Actual))))
then
if Conversion_OK (Actual) then
Init := OK_Convert_To (F_Typ, New_Occurrence_Of (Var, Loc));
else
Init := Convert_To (F_Typ, New_Occurrence_Of (Var, Loc));
end if;
elsif Ekind (Formal) = E_In_Parameter then
Init := New_Occurrence_Of (Var, Loc);
else
Init := Empty;
end if;
N_Node :=
Make_Object_Declaration (Loc,
Defining_Identifier => Temp,
Object_Definition => Indic,
Expression => Init);
Set_Assignment_OK (N_Node);
Insert_Action (N, N_Node);
-- Now, normally the deal here is that we use the defining
-- identifier created by that object declaration. There is
-- one exception to this. In the change of representation case
-- the above declaration will end up looking like:
-- temp : type := identifier;
-- And in this case we might as well use the identifier directly
-- and eliminate the temporary. Note that the analysis of the
-- declaration was not a waste of time in that case, since it is
-- what generated the necessary change of representation code. If
-- the change of representation introduced additional code, as in
-- a fixed-integer conversion, the expression is not an identifier
-- and must be kept.
if Crep
and then Present (Expression (N_Node))
and then Is_Entity_Name (Expression (N_Node))
then
Temp := Entity (Expression (N_Node));
Rewrite (N_Node, Make_Null_Statement (Loc));
end if;
-- For IN parameter, all we do is to replace the actual
if Ekind (Formal) = E_In_Parameter then
Rewrite (Actual, New_Reference_To (Temp, Loc));
Analyze (Actual);
-- Processing for OUT or IN OUT parameter
else
-- Kill current value indications for the temporary variable we
-- created, since we just passed it as an OUT parameter.
Kill_Current_Values (Temp);
-- If type conversion, use reverse conversion on exit
if Nkind (Actual) = N_Type_Conversion then
if Conversion_OK (Actual) then
Expr := OK_Convert_To (V_Typ, New_Occurrence_Of (Temp, Loc));
else
Expr := Convert_To (V_Typ, New_Occurrence_Of (Temp, Loc));
end if;
else
Expr := New_Occurrence_Of (Temp, Loc);
end if;
Rewrite (Actual, New_Reference_To (Temp, Loc));
Analyze (Actual);
Append_To (Post_Call,
Make_Assignment_Statement (Loc,
Name => New_Occurrence_Of (Var, Loc),
Expression => Expr));
Set_Assignment_OK (Name (Last (Post_Call)));
end if;
end Add_Call_By_Copy_Code;
----------------------------------
-- Add_Simple_Call_By_Copy_Code --
----------------------------------
procedure Add_Simple_Call_By_Copy_Code is
Temp : Entity_Id;
Decl : Node_Id;
Incod : Node_Id;
Outcod : Node_Id;
Lhs : Node_Id;
Rhs : Node_Id;
Indic : Node_Id;
F_Typ : constant Entity_Id := Etype (Formal);
begin
if not Is_Legal_Copy then
return;
end if;
-- Use formal type for temp, unless formal type is an unconstrained
-- array, in which case we don't have to worry about bounds checks,
-- and we use the actual type, since that has appropriate bounds.
if Is_Array_Type (F_Typ) and then not Is_Constrained (F_Typ) then
Indic := New_Occurrence_Of (Etype (Actual), Loc);
else
Indic := New_Occurrence_Of (Etype (Formal), Loc);
end if;
-- Prepare to generate code
Reset_Packed_Prefix;
Temp := Make_Defining_Identifier (Loc, New_Internal_Name ('T'));
Incod := Relocate_Node (Actual);
Outcod := New_Copy_Tree (Incod);
-- Generate declaration of temporary variable, initializing it
-- with the input parameter unless we have an OUT formal or
-- this is an initialization call.
-- If the formal is an out parameter with discriminants, the
-- discriminants must be captured even if the rest of the object
-- is in principle uninitialized, because the discriminants may
-- be read by the called subprogram.
if Ekind (Formal) = E_Out_Parameter then
Incod := Empty;
if Has_Discriminants (Etype (Formal)) then
Indic := New_Occurrence_Of (Etype (Actual), Loc);
end if;
elsif Inside_Init_Proc then
-- Could use a comment here to match comment below ???
if Nkind (Actual) /= N_Selected_Component
or else
not Has_Discriminant_Dependent_Constraint
(Entity (Selector_Name (Actual)))
then
Incod := Empty;
-- Otherwise, keep the component in order to generate the proper
-- actual subtype, that depends on enclosing discriminants.
else
null;
end if;
end if;
Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Temp,
Object_Definition => Indic,
Expression => Incod);
if Inside_Init_Proc
and then No (Incod)
then
-- If the call is to initialize a component of a composite type,
-- and the component does not depend on discriminants, use the
-- actual type of the component. This is required in case the
-- component is constrained, because in general the formal of the
-- initialization procedure will be unconstrained. Note that if
-- the component being initialized is constrained by an enclosing
-- discriminant, the presence of the initialization in the
-- declaration will generate an expression for the actual subtype.
Set_No_Initialization (Decl);
Set_Object_Definition (Decl,
New_Occurrence_Of (Etype (Actual), Loc));
end if;
Insert_Action (N, Decl);
-- The actual is simply a reference to the temporary
Rewrite (Actual, New_Occurrence_Of (Temp, Loc));
-- Generate copy out if OUT or IN OUT parameter
if Ekind (Formal) /= E_In_Parameter then
Lhs := Outcod;
Rhs := New_Occurrence_Of (Temp, Loc);
-- Deal with conversion
if Nkind (Lhs) = N_Type_Conversion then
Lhs := Expression (Lhs);
Rhs := Convert_To (Etype (Actual), Rhs);
end if;
Append_To (Post_Call,
Make_Assignment_Statement (Loc,
Name => Lhs,
Expression => Rhs));
Set_Assignment_OK (Name (Last (Post_Call)));
end if;
end Add_Simple_Call_By_Copy_Code;
---------------------------
-- Check_Fortran_Logical --
---------------------------
procedure Check_Fortran_Logical is
Logical : constant Entity_Id := Etype (Formal);
Var : Entity_Id;
-- Note: this is very incomplete, e.g. it does not handle arrays
-- of logical values. This is really not the right approach at all???)
begin
if Convention (Subp) = Convention_Fortran
and then Root_Type (Etype (Formal)) = Standard_Boolean
and then Ekind (Formal) /= E_In_Parameter
then
Var := Make_Var (Actual);
Append_To (Post_Call,
Make_Assignment_Statement (Loc,
Name => New_Occurrence_Of (Var, Loc),
Expression =>
Unchecked_Convert_To (
Logical,
Make_Op_Ne (Loc,
Left_Opnd => New_Occurrence_Of (Var, Loc),
Right_Opnd =>
Unchecked_Convert_To (
Logical,
New_Occurrence_Of (Standard_False, Loc))))));
end if;
end Check_Fortran_Logical;
-------------------
-- Is_Legal_Copy --
-------------------
function Is_Legal_Copy return Boolean is
begin
-- An attempt to copy a value of such a type can only occur if
-- representation clauses give the actual a misaligned address.
if Is_By_Reference_Type (Etype (Formal)) then
Error_Msg_N
("misaligned actual cannot be passed by reference", Actual);
return False;
-- For users of Starlet, we assume that the specification of by-
-- reference mechanism is mandatory. This may lead to unligned
-- objects but at least for DEC legacy code it is known to work.
-- The warning will alert users of this code that a problem may
-- be lurking.
elsif Mechanism (Formal) = By_Reference
and then Is_Valued_Procedure (Scope (Formal))
then
Error_Msg_N
("by_reference actual may be misaligned?", Actual);
return False;
else
return True;
end if;
end Is_Legal_Copy;
--------------
-- Make_Var --
--------------
function Make_Var (Actual : Node_Id) return Entity_Id is
Var : Entity_Id;
begin
if Is_Entity_Name (Actual) then
return Entity (Actual);
else
Var := Make_Defining_Identifier (Loc, New_Internal_Name ('T'));
N_Node :=
Make_Object_Renaming_Declaration (Loc,
Defining_Identifier => Var,
Subtype_Mark =>
New_Occurrence_Of (Etype (Actual), Loc),
Name => Relocate_Node (Actual));
Insert_Action (N, N_Node);
return Var;
end if;
end Make_Var;
-------------------------
-- Reset_Packed_Prefix --
-------------------------
procedure Reset_Packed_Prefix is
Pfx : Node_Id := Actual;
begin
loop
Set_Analyzed (Pfx, False);
exit when Nkind (Pfx) /= N_Selected_Component
and then Nkind (Pfx) /= N_Indexed_Component;
Pfx := Prefix (Pfx);
end loop;
end Reset_Packed_Prefix;
-- Start of processing for Expand_Actuals
begin
Post_Call := New_List;
Formal := First_Formal (Subp);
Actual := First_Actual (N);
while Present (Formal) loop
E_Formal := Etype (Formal);
if Is_Scalar_Type (E_Formal)
or else Nkind (Actual) = N_Slice
then
Check_Fortran_Logical;
-- RM 6.4.1 (11)
elsif Ekind (Formal) /= E_Out_Parameter then
-- The unusual case of the current instance of a protected type
-- requires special handling. This can only occur in the context
-- of a call within the body of a protected operation.
if Is_Entity_Name (Actual)
and then Ekind (Entity (Actual)) = E_Protected_Type
and then In_Open_Scopes (Entity (Actual))
then
if Scope (Subp) /= Entity (Actual) then
Error_Msg_N ("operation outside protected type may not "
& "call back its protected operations?", Actual);
end if;
Rewrite (Actual,
Expand_Protected_Object_Reference (N, Entity (Actual)));
end if;
Apply_Constraint_Check (Actual, E_Formal);
-- Out parameter case. No constraint checks on access type
-- RM 6.4.1 (13)
elsif Is_Access_Type (E_Formal) then
null;
-- RM 6.4.1 (14)
elsif Has_Discriminants (Base_Type (E_Formal))
or else Has_Non_Null_Base_Init_Proc (E_Formal)
then
Apply_Constraint_Check (Actual, E_Formal);
-- RM 6.4.1 (15)
else
Apply_Constraint_Check (Actual, Base_Type (E_Formal));
end if;
-- Processing for IN-OUT and OUT parameters
if Ekind (Formal) /= E_In_Parameter then
-- For type conversions of arrays, apply length/range checks
if Is_Array_Type (E_Formal)
and then Nkind (Actual) = N_Type_Conversion
then
if Is_Constrained (E_Formal) then
Apply_Length_Check (Expression (Actual), E_Formal);
else
Apply_Range_Check (Expression (Actual), E_Formal);
end if;
end if;
-- If argument is a type conversion for a type that is passed
-- by copy, then we must pass the parameter by copy.
if Nkind (Actual) = N_Type_Conversion
and then
(Is_Numeric_Type (E_Formal)
or else Is_Access_Type (E_Formal)
or else Is_Enumeration_Type (E_Formal)
or else Is_Bit_Packed_Array (Etype (Formal))
or else Is_Bit_Packed_Array (Etype (Expression (Actual)))
-- Also pass by copy if change of representation
or else not Same_Representation
(Etype (Formal),
Etype (Expression (Actual))))
then
Add_Call_By_Copy_Code;
-- References to components of bit packed arrays are expanded
-- at this point, rather than at the point of analysis of the
-- actuals, to handle the expansion of the assignment to
-- [in] out parameters.
elsif Is_Ref_To_Bit_Packed_Array (Actual) then
Add_Simple_Call_By_Copy_Code;
-- If a non-scalar actual is possibly unaligned, we need a copy
elsif Is_Possibly_Unaligned_Object (Actual)
and then not Represented_As_Scalar (Etype (Formal))
then
Add_Simple_Call_By_Copy_Code;
-- References to slices of bit packed arrays are expanded
elsif Is_Ref_To_Bit_Packed_Slice (Actual) then
Add_Call_By_Copy_Code;
-- References to possibly unaligned slices of arrays are expanded
elsif Is_Possibly_Unaligned_Slice (Actual) then
Add_Call_By_Copy_Code;
-- Deal with access types where the actual subtpe and the
-- formal subtype are not the same, requiring a check.
-- It is necessary to exclude tagged types because of "downward
-- conversion" errors and a strange assertion error in namet
-- from gnatf in bug 1215-001 ???
elsif Is_Access_Type (E_Formal)
and then not Same_Type (E_Formal, Etype (Actual))
and then not Is_Tagged_Type (Designated_Type (E_Formal))
then
Add_Call_By_Copy_Code;
-- If the actual is not a scalar and is marked for volatile
-- treatment, whereas the formal is not volatile, then pass
-- by copy unless it is a by-reference type.
elsif Is_Entity_Name (Actual)
and then Treat_As_Volatile (Entity (Actual))
and then not Is_By_Reference_Type (Etype (Actual))
and then not Is_Scalar_Type (Etype (Entity (Actual)))
and then not Treat_As_Volatile (E_Formal)
then
Add_Call_By_Copy_Code;
elsif Nkind (Actual) = N_Indexed_Component
and then Is_Entity_Name (Prefix (Actual))
and then Has_Volatile_Components (Entity (Prefix (Actual)))
then
Add_Call_By_Copy_Code;
end if;
-- Processing for IN parameters
else
-- For IN parameters is in the packed array case, we expand an
-- indexed component (the circuit in Exp_Ch4 deliberately left
-- indexed components appearing as actuals untouched, so that
-- the special processing above for the OUT and IN OUT cases
-- could be performed. We could make the test in Exp_Ch4 more
-- complex and have it detect the parameter mode, but it is
-- easier simply to handle all cases here.)
if Nkind (Actual) = N_Indexed_Component
and then Is_Packed (Etype (Prefix (Actual)))
then
Reset_Packed_Prefix;
Expand_Packed_Element_Reference (Actual);
-- If we have a reference to a bit packed array, we copy it,
-- since the actual must be byte aligned.
-- Is this really necessary in all cases???
elsif Is_Ref_To_Bit_Packed_Array (Actual) then
Add_Simple_Call_By_Copy_Code;
-- If a non-scalar actual is possibly unaligned, we need a copy
elsif Is_Possibly_Unaligned_Object (Actual)
and then not Represented_As_Scalar (Etype (Formal))
then
Add_Simple_Call_By_Copy_Code;
-- Similarly, we have to expand slices of packed arrays here
-- because the result must be byte aligned.
elsif Is_Ref_To_Bit_Packed_Slice (Actual) then
Add_Call_By_Copy_Code;
-- Only processing remaining is to pass by copy if this is a
-- reference to a possibly unaligned slice, since the caller
-- expects an appropriately aligned argument.
elsif Is_Possibly_Unaligned_Slice (Actual) then
Add_Call_By_Copy_Code;
end if;
end if;
Next_Formal (Formal);
Next_Actual (Actual);
end loop;
-- Find right place to put post call stuff if it is present
if not Is_Empty_List (Post_Call) then
-- If call is not a list member, it must be the triggering statement
-- of a triggering alternative or an entry call alternative, and we
-- can add the post call stuff to the corresponding statement list.
if not Is_List_Member (N) then
declare
P : constant Node_Id := Parent (N);
begin
pragma Assert (Nkind (P) = N_Triggering_Alternative
or else Nkind (P) = N_Entry_Call_Alternative);
if Is_Non_Empty_List (Statements (P)) then
Insert_List_Before_And_Analyze
(First (Statements (P)), Post_Call);
else
Set_Statements (P, Post_Call);
end if;
end;
-- Otherwise, normal case where N is in a statement sequence,
-- just put the post-call stuff after the call statement.
else
Insert_Actions_After (N, Post_Call);
end if;
end if;
-- The call node itself is re-analyzed in Expand_Call
end Expand_Actuals;
-----------------
-- Expand_Call --
-----------------
-- This procedure handles expansion of function calls and procedure call
-- statements (i.e. it serves as the body for Expand_N_Function_Call and
-- Expand_N_Procedure_Call_Statement. Processing for calls includes:
-- Replace call to Raise_Exception by Raise_Exception always if possible
-- Provide values of actuals for all formals in Extra_Formals list
-- Replace "call" to enumeration literal function by literal itself
-- Rewrite call to predefined operator as operator
-- Replace actuals to in-out parameters that are numeric conversions,
-- with explicit assignment to temporaries before and after the call.
-- Remove optional actuals if First_Optional_Parameter specified.
-- Note that the list of actuals has been filled with default expressions
-- during semantic analysis of the call. Only the extra actuals required
-- for the 'Constrained attribute and for accessibility checks are added
-- at this point.
procedure Expand_Call (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Remote : constant Boolean := Is_Remote_Call (N);
Subp : Entity_Id;
Orig_Subp : Entity_Id := Empty;
Parent_Subp : Entity_Id;
Parent_Formal : Entity_Id;
Actual : Node_Id;
Formal : Entity_Id;
Prev : Node_Id := Empty;
Prev_Orig : Node_Id;
-- Original node for an actual, which may have been rewritten. If the
-- actual is a function call that has been transformed from a selected
-- component, the original node is unanalyzed. Otherwise, it carries
-- semantic information used to generate additional actuals.
Scop : Entity_Id;
Extra_Actuals : List_Id := No_List;
CW_Interface_Formals_Present : Boolean := False;
procedure Add_Actual_Parameter (Insert_Param : Node_Id);
-- Adds one entry to the end of the actual parameter list. Used for
-- default parameters and for extra actuals (for Extra_Formals). The
-- argument is an N_Parameter_Association node.
procedure Add_Extra_Actual (Expr : Node_Id; EF : Entity_Id);
-- Adds an extra actual to the list of extra actuals. Expr is the
-- expression for the value of the actual, EF is the entity for the
-- extra formal.
function Inherited_From_Formal (S : Entity_Id) return Entity_Id;
-- Within an instance, a type derived from a non-tagged formal derived
-- type inherits from the original parent, not from the actual. This is
-- tested in 4723-003. The current derivation mechanism has the derived
-- type inherit from the actual, which is only correct outside of the
-- instance. If the subprogram is inherited, we test for this particular
-- case through a convoluted tree traversal before setting the proper
-- subprogram to be called.
--------------------------
-- Add_Actual_Parameter --
--------------------------
procedure Add_Actual_Parameter (Insert_Param : Node_Id) is
Actual_Expr : constant Node_Id :=
Explicit_Actual_Parameter (Insert_Param);
begin
-- Case of insertion is first named actual
if No (Prev) or else
Nkind (Parent (Prev)) /= N_Parameter_Association
then
Set_Next_Named_Actual (Insert_Param, First_Named_Actual (N));
Set_First_Named_Actual (N, Actual_Expr);
if No (Prev) then
if No (Parameter_Associations (N)) then
Set_Parameter_Associations (N, New_List);
Append (Insert_Param, Parameter_Associations (N));
end if;
else
Insert_After (Prev, Insert_Param);
end if;
-- Case of insertion is not first named actual
else
Set_Next_Named_Actual
(Insert_Param, Next_Named_Actual (Parent (Prev)));
Set_Next_Named_Actual (Parent (Prev), Actual_Expr);
Append (Insert_Param, Parameter_Associations (N));
end if;
Prev := Actual_Expr;
end Add_Actual_Parameter;
----------------------
-- Add_Extra_Actual --
----------------------
procedure Add_Extra_Actual (Expr : Node_Id; EF : Entity_Id) is
Loc : constant Source_Ptr := Sloc (Expr);
begin
if Extra_Actuals = No_List then
Extra_Actuals := New_List;
Set_Parent (Extra_Actuals, N);
end if;
Append_To (Extra_Actuals,
Make_Parameter_Association (Loc,
Explicit_Actual_Parameter => Expr,
Selector_Name =>
Make_Identifier (Loc, Chars (EF))));
Analyze_And_Resolve (Expr, Etype (EF));
end Add_Extra_Actual;
---------------------------
-- Inherited_From_Formal --
---------------------------
function Inherited_From_Formal (S : Entity_Id) return Entity_Id is
Par : Entity_Id;
Gen_Par : Entity_Id;
Gen_Prim : Elist_Id;
Elmt : Elmt_Id;
Indic : Node_Id;
begin
-- If the operation is inherited, it is attached to the corresponding
-- type derivation. If the parent in the derivation is a generic
-- actual, it is a subtype of the actual, and we have to recover the
-- original derived type declaration to find the proper parent.
if Nkind (Parent (S)) /= N_Full_Type_Declaration
or else not Is_Derived_Type (Defining_Identifier (Parent (S)))
or else Nkind (Type_Definition (Original_Node (Parent (S)))) /=
N_Derived_Type_Definition
or else not In_Instance
then
return Empty;
else
Indic :=
(Subtype_Indication
(Type_Definition (Original_Node (Parent (S)))));
if Nkind (Indic) = N_Subtype_Indication then
Par := Entity (Subtype_Mark (Indic));
else
Par := Entity (Indic);
end if;
end if;
if not Is_Generic_Actual_Type (Par)
or else Is_Tagged_Type (Par)
or else Nkind (Parent (Par)) /= N_Subtype_Declaration
or else not In_Open_Scopes (Scope (Par))
then
return Empty;
else
Gen_Par := Generic_Parent_Type (Parent (Par));
end if;
-- If the generic parent type is still the generic type, this is a
-- private formal, not a derived formal, and there are no operations
-- inherited from the formal.
if Nkind (Parent (Gen_Par)) = N_Formal_Type_Declaration then
return Empty;
end if;
Gen_Prim := Collect_Primitive_Operations (Gen_Par);
Elmt := First_Elmt (Gen_Prim);
while Present (Elmt) loop
if Chars (Node (Elmt)) = Chars (S) then
declare
F1 : Entity_Id;
F2 : Entity_Id;
begin
F1 := First_Formal (S);
F2 := First_Formal (Node (Elmt));
while Present (F1)
and then Present (F2)
loop
if Etype (F1) = Etype (F2)
or else Etype (F2) = Gen_Par
then
Next_Formal (F1);
Next_Formal (F2);
else
Next_Elmt (Elmt);
exit; -- not the right subprogram
end if;
return Node (Elmt);
end loop;
end;
else
Next_Elmt (Elmt);
end if;
end loop;
raise Program_Error;
end Inherited_From_Formal;
-- Start of processing for Expand_Call
begin
-- Ignore if previous error
if Nkind (N) in N_Has_Etype and then Etype (N) = Any_Type then
return;
end if;
-- Call using access to subprogram with explicit dereference
if Nkind (Name (N)) = N_Explicit_Dereference then
Subp := Etype (Name (N));
Parent_Subp := Empty;
-- Case of call to simple entry, where the Name is a selected component
-- whose prefix is the task, and whose selector name is the entry name
elsif Nkind (Name (N)) = N_Selected_Component then
Subp := Entity (Selector_Name (Name (N)));
Parent_Subp := Empty;
-- Case of call to member of entry family, where Name is an indexed
-- component, with the prefix being a selected component giving the
-- task and entry family name, and the index being the entry index.
elsif Nkind (Name (N)) = N_Indexed_Component then
Subp := Entity (Selector_Name (Prefix (Name (N))));
Parent_Subp := Empty;
-- Normal case
else
Subp := Entity (Name (N));
Parent_Subp := Alias (Subp);
-- Replace call to Raise_Exception by call to Raise_Exception_Always
-- if we can tell that the first parameter cannot possibly be null.
-- This helps optimization and also generation of warnings.
if not Restriction_Active (No_Exception_Handlers)
and then Is_RTE (Subp, RE_Raise_Exception)
then
declare
FA : constant Node_Id := Original_Node (First_Actual (N));
begin
-- The case we catch is where the first argument is obtained
-- using the Identity attribute (which must always be
-- non-null).
if Nkind (FA) = N_Attribute_Reference
and then Attribute_Name (FA) = Name_Identity
then
Subp := RTE (RE_Raise_Exception_Always);
Set_Entity (Name (N), Subp);
end if;
end;
end if;
if Ekind (Subp) = E_Entry then
Parent_Subp := Empty;
end if;
end if;
-- Ada 2005 (AI-345): We have a procedure call as a triggering
-- alternative in an asynchronous select or as an entry call in
-- a conditional or timed select. Check whether the procedure call
-- is a renaming of an entry and rewrite it as an entry call.
if Ada_Version >= Ada_05
and then Nkind (N) = N_Procedure_Call_Statement
and then
((Nkind (Parent (N)) = N_Triggering_Alternative
and then Triggering_Statement (Parent (N)) = N)
or else
(Nkind (Parent (N)) = N_Entry_Call_Alternative
and then Entry_Call_Statement (Parent (N)) = N))
then
declare
Ren_Decl : Node_Id;
Ren_Root : Entity_Id := Subp;
begin
-- This may be a chain of renamings, find the root
if Present (Alias (Ren_Root)) then
Ren_Root := Alias (Ren_Root);
end if;
if Present (Original_Node (Parent (Parent (Ren_Root)))) then
Ren_Decl := Original_Node (Parent (Parent (Ren_Root)));
if Nkind (Ren_Decl) = N_Subprogram_Renaming_Declaration then
Rewrite (N,
Make_Entry_Call_Statement (Loc,
Name =>
New_Copy_Tree (Name (Ren_Decl)),
Parameter_Associations =>
New_Copy_List_Tree (Parameter_Associations (N))));
return;
end if;
end if;
end;
end if;
-- First step, compute extra actuals, corresponding to any
-- Extra_Formals present. Note that we do not access Extra_Formals
-- directly, instead we simply note the presence of the extra
-- formals as we process the regular formals and collect the
-- corresponding actuals in Extra_Actuals.
-- We also generate any required range checks for actuals as we go
-- through the loop, since this is a convenient place to do this.
Formal := First_Formal (Subp);
Actual := First_Actual (N);
while Present (Formal) loop
-- Generate range check if required (not activated yet ???)
-- if Do_Range_Check (Actual) then
-- Set_Do_Range_Check (Actual, False);
-- Generate_Range_Check
-- (Actual, Etype (Formal), CE_Range_Check_Failed);
-- end if;
-- Prepare to examine current entry
Prev := Actual;
Prev_Orig := Original_Node (Prev);
if not Analyzed (Prev_Orig)
and then Nkind (Actual) = N_Function_Call
then
Prev_Orig := Prev;
end if;
-- Ada 2005 (AI-251): Check if any formal is a class-wide interface
-- to expand it in a further round.
CW_Interface_Formals_Present :=
CW_Interface_Formals_Present
or else
(Ekind (Etype (Formal)) = E_Class_Wide_Type
and then Is_Interface (Etype (Etype (Formal))))
or else
(Ekind (Etype (Formal)) = E_Anonymous_Access_Type
and then Is_Interface (Directly_Designated_Type
(Etype (Etype (Formal)))));
-- Create possible extra actual for constrained case. Usually, the
-- extra actual is of the form actual'constrained, but since this
-- attribute is only available for unconstrained records, TRUE is
-- expanded if the type of the formal happens to be constrained (for
-- instance when this procedure is inherited from an unconstrained
-- record to a constrained one) or if the actual has no discriminant
-- (its type is constrained). An exception to this is the case of a
-- private type without discriminants. In this case we pass FALSE
-- because the object has underlying discriminants with defaults.
if Present (Extra_Constrained (Formal)) then
if Ekind (Etype (Prev)) in Private_Kind
and then not Has_Discriminants (Base_Type (Etype (Prev)))
then
Add_Extra_Actual (
New_Occurrence_Of (Standard_False, Loc),
Extra_Constrained (Formal));
elsif Is_Constrained (Etype (Formal))
or else not Has_Discriminants (Etype (Prev))
then
Add_Extra_Actual (
New_Occurrence_Of (Standard_True, Loc),
Extra_Constrained (Formal));
-- Do not produce extra actuals for Unchecked_Union parameters.
-- Jump directly to the end of the loop.
elsif Is_Unchecked_Union (Base_Type (Etype (Actual))) then
goto Skip_Extra_Actual_Generation;
else
-- If the actual is a type conversion, then the constrained
-- test applies to the actual, not the target type.
declare
Act_Prev : Node_Id;
begin
-- Test for unchecked conversions as well, which can occur
-- as out parameter actuals on calls to stream procedures.
Act_Prev := Prev;
while Nkind (Act_Prev) = N_Type_Conversion
or else Nkind (Act_Prev) = N_Unchecked_Type_Conversion
loop
Act_Prev := Expression (Act_Prev);
end loop;
-- If the expression is a conversion of a dereference,
-- this is internally generated code that manipulates
-- addresses, e.g. when building interface tables. No
-- check should occur in this case, and the discriminated
-- object is not directly a hand.
if not Comes_From_Source (Actual)
and then Nkind (Actual) = N_Unchecked_Type_Conversion
and then Nkind (Act_Prev) = N_Explicit_Dereference
then
Add_Extra_Actual
(New_Occurrence_Of (Standard_False, Loc),
Extra_Constrained (Formal));
else
Add_Extra_Actual
(Make_Attribute_Reference (Sloc (Prev),
Prefix =>
Duplicate_Subexpr_No_Checks
(Act_Prev, Name_Req => True),
Attribute_Name => Name_Constrained),
Extra_Constrained (Formal));
end if;
end;
end if;
end if;
-- Create possible extra actual for accessibility level
if Present (Extra_Accessibility (Formal)) then
if Is_Entity_Name (Prev_Orig) then
-- When passing an access parameter as the actual to another
-- access parameter we need to pass along the actual's own
-- associated access level parameter. This is done if we are
-- in the scope of the formal access parameter (if this is an
-- inlined body the extra formal is irrelevant).
if Ekind (Entity (Prev_Orig)) in Formal_Kind
and then Ekind (Etype (Prev_Orig)) = E_Anonymous_Access_Type
and then In_Open_Scopes (Scope (Entity (Prev_Orig)))
then
declare
Parm_Ent : constant Entity_Id := Param_Entity (Prev_Orig);
begin
pragma Assert (Present (Parm_Ent));
if Present (Extra_Accessibility (Parm_Ent)) then
Add_Extra_Actual
(New_Occurrence_Of
(Extra_Accessibility (Parm_Ent), Loc),
Extra_Accessibility (Formal));
-- If the actual access parameter does not have an
-- associated extra formal providing its scope level,
-- then treat the actual as having library-level
-- accessibility.
else
Add_Extra_Actual
(Make_Integer_Literal (Loc,
Intval => Scope_Depth (Standard_Standard)),
Extra_Accessibility (Formal));
end if;
end;
-- The actual is a normal access value, so just pass the
-- level of the actual's access type.
else
Add_Extra_Actual
(Make_Integer_Literal (Loc,
Intval => Type_Access_Level (Etype (Prev_Orig))),
Extra_Accessibility (Formal));
end if;
else
case Nkind (Prev_Orig) is
when N_Attribute_Reference =>
case Get_Attribute_Id (Attribute_Name (Prev_Orig)) is
-- For X'Access, pass on the level of the prefix X
when Attribute_Access =>
Add_Extra_Actual (
Make_Integer_Literal (Loc,
Intval =>
Object_Access_Level (Prefix (Prev_Orig))),
Extra_Accessibility (Formal));
-- Treat the unchecked attributes as library-level
when Attribute_Unchecked_Access |
Attribute_Unrestricted_Access =>
Add_Extra_Actual (
Make_Integer_Literal (Loc,
Intval => Scope_Depth (Standard_Standard)),
Extra_Accessibility (Formal));
-- No other cases of attributes returning access
-- values that can be passed to access parameters
when others =>
raise Program_Error;
end case;
-- For allocators we pass the level of the execution of
-- the called subprogram, which is one greater than the
-- current scope level.
when N_Allocator =>
Add_Extra_Actual (
Make_Integer_Literal (Loc,
Scope_Depth (Current_Scope) + 1),
Extra_Accessibility (Formal));
-- For other cases we simply pass the level of the
-- actual's access type.
when others =>
Add_Extra_Actual (
Make_Integer_Literal (Loc,
Intval => Type_Access_Level (Etype (Prev_Orig))),
Extra_Accessibility (Formal));
end case;
end if;
end if;
-- Perform the check of 4.6(49) that prevents a null value from being
-- passed as an actual to an access parameter. Note that the check is
-- elided in the common cases of passing an access attribute or
-- access parameter as an actual. Also, we currently don't enforce
-- this check for expander-generated actuals and when -gnatdj is set.
if Ada_Version >= Ada_05 then
-- Ada 2005 (AI-231): Check null-excluding access types
if Is_Access_Type (Etype (Formal))
and then Can_Never_Be_Null (Etype (Formal))
and then Nkind (Prev) /= N_Raise_Constraint_Error
and then (Nkind (Prev) = N_Null
or else not Can_Never_Be_Null (Etype (Prev)))
then
Install_Null_Excluding_Check (Prev);
end if;
-- Ada_Version < Ada_05
else
if Ekind (Etype (Formal)) /= E_Anonymous_Access_Type
or else Access_Checks_Suppressed (Subp)
then
null;
elsif Debug_Flag_J then
null;
elsif not Comes_From_Source (Prev) then
null;
elsif Is_Entity_Name (Prev)
and then Ekind (Etype (Prev)) = E_Anonymous_Access_Type
then
null;
elsif Nkind (Prev) = N_Allocator
or else Nkind (Prev) = N_Attribute_Reference
then
null;
-- Suppress null checks when passing to access parameters of Java
-- subprograms. (Should this be done for other foreign conventions
-- as well ???)
elsif Convention (Subp) = Convention_Java then
null;
else
Install_Null_Excluding_Check (Prev);
end if;
end if;
-- Perform appropriate validity checks on parameters that
-- are entities.
if Validity_Checks_On then
if (Ekind (Formal) = E_In_Parameter
and then Validity_Check_In_Params)
or else
(Ekind (Formal) = E_In_Out_Parameter
and then Validity_Check_In_Out_Params)
then
-- If the actual is an indexed component of a packed
-- type, it has not been expanded yet. It will be
-- copied in the validity code that follows, and has
-- to be expanded appropriately, so reanalyze it.
if Nkind (Actual) = N_Indexed_Component then
Set_Analyzed (Actual, False);
end if;
Ensure_Valid (Actual);
end if;
end if;
-- For IN OUT and OUT parameters, ensure that subscripts are valid
-- since this is a left side reference. We only do this for calls
-- from the source program since we assume that compiler generated
-- calls explicitly generate any required checks. We also need it
-- only if we are doing standard validity checks, since clearly it
-- is not needed if validity checks are off, and in subscript
-- validity checking mode, all indexed components are checked with
-- a call directly from Expand_N_Indexed_Component.
if Comes_From_Source (N)
and then Ekind (Formal) /= E_In_Parameter
and then Validity_Checks_On
and then Validity_Check_Default
and then not Validity_Check_Subscripts
then
Check_Valid_Lvalue_Subscripts (Actual);
end if;
-- Mark any scalar OUT parameter that is a simple variable as no
-- longer known to be valid (unless the type is always valid). This
-- reflects the fact that if an OUT parameter is never set in a
-- procedure, then it can become invalid on the procedure return.
if Ekind (Formal) = E_Out_Parameter
and then Is_Entity_Name (Actual)
and then Ekind (Entity (Actual)) = E_Variable
and then not Is_Known_Valid (Etype (Actual))
then
Set_Is_Known_Valid (Entity (Actual), False);
end if;
-- For an OUT or IN OUT parameter, if the actual is an entity, then
-- clear current values, since they can be clobbered. We are probably
-- doing this in more places than we need to, but better safe than
-- sorry when it comes to retaining bad current values!
if Ekind (Formal) /= E_In_Parameter
and then Is_Entity_Name (Actual)
then
Kill_Current_Values (Entity (Actual));
end if;
-- If the formal is class wide and the actual is an aggregate, force
-- evaluation so that the back end who does not know about class-wide
-- type, does not generate a temporary of the wrong size.
if not Is_Class_Wide_Type (Etype (Formal)) then
null;
elsif Nkind (Actual) = N_Aggregate
or else (Nkind (Actual) = N_Qualified_Expression
and then Nkind (Expression (Actual)) = N_Aggregate)
then
Force_Evaluation (Actual);
end if;
-- In a remote call, if the formal is of a class-wide type, check
-- that the actual meets the requirements described in E.4(18).
if Remote
and then Is_Class_Wide_Type (Etype (Formal))
then
Insert_Action (Actual,
Make_Implicit_If_Statement (N,
Condition =>
Make_Op_Not (Loc,
Get_Remotely_Callable
(Duplicate_Subexpr_Move_Checks (Actual))),
Then_Statements => New_List (
Make_Raise_Program_Error (Loc,
Reason => PE_Illegal_RACW_E_4_18))));
end if;
-- This label is required when skipping extra actual generation for
-- Unchecked_Union parameters.
<<Skip_Extra_Actual_Generation>>
Next_Actual (Actual);
Next_Formal (Formal);
end loop;
-- If we are expanding a rhs of an assignment we need to check if tag
-- propagation is needed. You might expect this processing to be in
-- Analyze_Assignment but has to be done earlier (bottom-up) because the
-- assignment might be transformed to a declaration for an unconstrained
-- value if the expression is classwide.
if Nkind (N) = N_Function_Call
and then Is_Tag_Indeterminate (N)
and then Is_Entity_Name (Name (N))
then
declare
Ass : Node_Id := Empty;
begin
if Nkind (Parent (N)) = N_Assignment_Statement then
Ass := Parent (N);
elsif Nkind (Parent (N)) = N_Qualified_Expression
and then Nkind (Parent (Parent (N))) = N_Assignment_Statement
then
Ass := Parent (Parent (N));
end if;
if Present (Ass)
and then Is_Class_Wide_Type (Etype (Name (Ass)))
then
if Etype (N) /= Root_Type (Etype (Name (Ass))) then
Error_Msg_NE
("tag-indeterminate expression must have type&"
& "('R'M 5.2 (6))", N, Root_Type (Etype (Name (Ass))));
else
Propagate_Tag (Name (Ass), N);
end if;
-- The call will be rewritten as a dispatching call, and
-- expanded as such.
return;
end if;
end;
end if;
-- Ada 2005 (AI-251): If some formal is a class-wide interface, expand
-- it to point to the correct secondary virtual table
if (Nkind (N) = N_Function_Call
or else Nkind (N) = N_Procedure_Call_Statement)
and then CW_Interface_Formals_Present
then
Expand_Interface_Actuals (N);
end if;
-- Deals with Dispatch_Call if we still have a call, before expanding
-- extra actuals since this will be done on the re-analysis of the
-- dispatching call. Note that we do not try to shorten the actual
-- list for a dispatching call, it would not make sense to do so.
-- Expansion of dispatching calls is suppressed when Java_VM, because
-- the JVM back end directly handles the generation of dispatching
-- calls and would have to undo any expansion to an indirect call.
if (Nkind (N) = N_Function_Call
or else Nkind (N) = N_Procedure_Call_Statement)
and then Present (Controlling_Argument (N))
and then not Java_VM
then
Expand_Dispatching_Call (N);
-- The following return is worrisome. Is it really OK to
-- skip all remaining processing in this procedure ???
return;
-- Similarly, expand calls to RCI subprograms on which pragma
-- All_Calls_Remote applies. The rewriting will be reanalyzed
-- later. Do this only when the call comes from source since we do
-- not want such a rewritting to occur in expanded code.
elsif Is_All_Remote_Call (N) then
Expand_All_Calls_Remote_Subprogram_Call (N);
-- Similarly, do not add extra actuals for an entry call whose entity
-- is a protected procedure, or for an internal protected subprogram
-- call, because it will be rewritten as a protected subprogram call
-- and reanalyzed (see Expand_Protected_Subprogram_Call).
elsif Is_Protected_Type (Scope (Subp))
and then (Ekind (Subp) = E_Procedure
or else Ekind (Subp) = E_Function)
then
null;
-- During that loop we gathered the extra actuals (the ones that
-- correspond to Extra_Formals), so now they can be appended.
else
while Is_Non_Empty_List (Extra_Actuals) loop
Add_Actual_Parameter (Remove_Head (Extra_Actuals));
end loop;
end if;
-- At this point we have all the actuals, so this is the point at
-- which the various expansion activities for actuals is carried out.
Expand_Actuals (N, Subp);
-- If the subprogram is a renaming, or if it is inherited, replace it
-- in the call with the name of the actual subprogram being called.
-- If this is a dispatching call, the run-time decides what to call.
-- The Alias attribute does not apply to entries.
if Nkind (N) /= N_Entry_Call_Statement
and then No (Controlling_Argument (N))
and then Present (Parent_Subp)
then
if Present (Inherited_From_Formal (Subp)) then
Parent_Subp := Inherited_From_Formal (Subp);
else
while Present (Alias (Parent_Subp)) loop
Parent_Subp := Alias (Parent_Subp);
end loop;
end if;
-- The below setting of Entity is suspect, see F109-018 discussion???
Set_Entity (Name (N), Parent_Subp);
if Is_Abstract (Parent_Subp)
and then not In_Instance
then
Error_Msg_NE
("cannot call abstract subprogram &!", Name (N), Parent_Subp);
end if;
-- Add an explicit conversion for parameter of the derived type.
-- This is only done for scalar and access in-parameters. Others
-- have been expanded in expand_actuals.
Formal := First_Formal (Subp);
Parent_Formal := First_Formal (Parent_Subp);
Actual := First_Actual (N);
-- It is not clear that conversion is needed for intrinsic
-- subprograms, but it certainly is for those that are user-
-- defined, and that can be inherited on derivation, namely
-- unchecked conversion and deallocation.
-- General case needs study ???
if not Is_Intrinsic_Subprogram (Parent_Subp)
or else Is_Generic_Instance (Parent_Subp)
then
while Present (Formal) loop
if Etype (Formal) /= Etype (Parent_Formal)
and then Is_Scalar_Type (Etype (Formal))
and then Ekind (Formal) = E_In_Parameter
and then not Raises_Constraint_Error (Actual)
then
Rewrite (Actual,
OK_Convert_To (Etype (Parent_Formal),
Relocate_Node (Actual)));
Analyze (Actual);
Resolve (Actual, Etype (Parent_Formal));
Enable_Range_Check (Actual);
elsif Is_Access_Type (Etype (Formal))
and then Base_Type (Etype (Parent_Formal)) /=
Base_Type (Etype (Actual))
then
if Ekind (Formal) /= E_In_Parameter then
Rewrite (Actual,
Convert_To (Etype (Parent_Formal),
Relocate_Node (Actual)));
Analyze (Actual);
Resolve (Actual, Etype (Parent_Formal));
elsif
Ekind (Etype (Parent_Formal)) = E_Anonymous_Access_Type
and then Designated_Type (Etype (Parent_Formal))
/=
Designated_Type (Etype (Actual))
and then not Is_Controlling_Formal (Formal)
then
-- This unchecked conversion is not necessary unless
-- inlining is enabled, because in that case the type
-- mismatch may become visible in the body about to be
-- inlined.
Rewrite (Actual,
Unchecked_Convert_To (Etype (Parent_Formal),
Relocate_Node (Actual)));
Analyze (Actual);
Resolve (Actual, Etype (Parent_Formal));
end if;
end if;
Next_Formal (Formal);
Next_Formal (Parent_Formal);
Next_Actual (Actual);
end loop;
end if;
Orig_Subp := Subp;
Subp := Parent_Subp;
end if;
-- Check for violation of No_Abort_Statements
if Is_RTE (Subp, RE_Abort_Task) then
Check_Restriction (No_Abort_Statements, N);
-- Check for violation of No_Dynamic_Attachment
elsif RTU_Loaded (Ada_Interrupts)
and then (Is_RTE (Subp, RE_Is_Reserved) or else
Is_RTE (Subp, RE_Is_Attached) or else
Is_RTE (Subp, RE_Current_Handler) or else
Is_RTE (Subp, RE_Attach_Handler) or else
Is_RTE (Subp, RE_Exchange_Handler) or else
Is_RTE (Subp, RE_Detach_Handler) or else
Is_RTE (Subp, RE_Reference))
then
Check_Restriction (No_Dynamic_Attachment, N);
end if;
-- Deal with case where call is an explicit dereference
if Nkind (Name (N)) = N_Explicit_Dereference then
-- Handle case of access to protected subprogram type
if Ekind (Base_Type (Etype (Prefix (Name (N))))) =
E_Access_Protected_Subprogram_Type
then
-- If this is a call through an access to protected operation,
-- the prefix has the form (object'address, operation'access).
-- Rewrite as a for other protected calls: the object is the
-- first parameter of the list of actuals.
declare
Call : Node_Id;
Parm : List_Id;
Nam : Node_Id;
Obj : Node_Id;
Ptr : constant Node_Id := Prefix (Name (N));
T : constant Entity_Id :=
Equivalent_Type (Base_Type (Etype (Ptr)));
D_T : constant Entity_Id :=
Designated_Type (Base_Type (Etype (Ptr)));
begin
Obj :=
Make_Selected_Component (Loc,
Prefix => Unchecked_Convert_To (T, Ptr),
Selector_Name =>
New_Occurrence_Of (First_Entity (T), Loc));
Nam :=
Make_Selected_Component (Loc,
Prefix => Unchecked_Convert_To (T, Ptr),
Selector_Name =>
New_Occurrence_Of (Next_Entity (First_Entity (T)), Loc));
Nam := Make_Explicit_Dereference (Loc, Nam);
if Present (Parameter_Associations (N)) then
Parm := Parameter_Associations (N);
else
Parm := New_List;
end if;
Prepend (Obj, Parm);
if Etype (D_T) = Standard_Void_Type then
Call := Make_Procedure_Call_Statement (Loc,
Name => Nam,
Parameter_Associations => Parm);
else
Call := Make_Function_Call (Loc,
Name => Nam,
Parameter_Associations => Parm);
end if;
Set_First_Named_Actual (Call, First_Named_Actual (N));
Set_Etype (Call, Etype (D_T));
-- We do not re-analyze the call to avoid infinite recursion.
-- We analyze separately the prefix and the object, and set
-- the checks on the prefix that would otherwise be emitted
-- when resolving a call.
Rewrite (N, Call);
Analyze (Nam);
Apply_Access_Check (Nam);
Analyze (Obj);
return;
end;
end if;
end if;
-- If this is a call to an intrinsic subprogram, then perform the
-- appropriate expansion to the corresponding tree node and we
-- are all done (since after that the call is gone!)
-- In the case where the intrinsic is to be processed by the back end,
-- the call to Expand_Intrinsic_Call will do nothing, which is fine,
-- since the idea in this case is to pass the call unchanged.
if Is_Intrinsic_Subprogram (Subp) then
Expand_Intrinsic_Call (N, Subp);
return;
end if;
if Ekind (Subp) = E_Function
or else Ekind (Subp) = E_Procedure
then
if Is_Inlined (Subp) then
Inlined_Subprogram : declare
Bod : Node_Id;
Must_Inline : Boolean := False;
Spec : constant Node_Id := Unit_Declaration_Node (Subp);
Scop : constant Entity_Id := Scope (Subp);
function In_Unfrozen_Instance return Boolean;
-- If the subprogram comes from an instance in the same
-- unit, and the instance is not yet frozen, inlining might
-- trigger order-of-elaboration problems in gigi.
--------------------------
-- In_Unfrozen_Instance --
--------------------------
function In_Unfrozen_Instance return Boolean is
S : Entity_Id;
begin
S := Scop;
while Present (S)
and then S /= Standard_Standard
loop
if Is_Generic_Instance (S)
and then Present (Freeze_Node (S))
and then not Analyzed (Freeze_Node (S))
then
return True;
end if;
S := Scope (S);
end loop;
return False;
end In_Unfrozen_Instance;
-- Start of processing for Inlined_Subprogram
begin
-- Verify that the body to inline has already been seen, and
-- that if the body is in the current unit the inlining does
-- not occur earlier. This avoids order-of-elaboration problems
-- in the back end.
-- This should be documented in sinfo/einfo ???
if No (Spec)
or else Nkind (Spec) /= N_Subprogram_Declaration
or else No (Body_To_Inline (Spec))
then
Must_Inline := False;
-- If this an inherited function that returns a private
-- type, do not inline if the full view is an unconstrained
-- array, because such calls cannot be inlined.
elsif Present (Orig_Subp)
and then Is_Array_Type (Etype (Orig_Subp))
and then not Is_Constrained (Etype (Orig_Subp))
then
Must_Inline := False;
elsif In_Unfrozen_Instance then
Must_Inline := False;
else
Bod := Body_To_Inline (Spec);
if (In_Extended_Main_Code_Unit (N)
or else In_Extended_Main_Code_Unit (Parent (N))
or else Is_Always_Inlined (Subp))
and then (not In_Same_Extended_Unit (Sloc (Bod), Loc)
or else
Earlier_In_Extended_Unit (Sloc (Bod), Loc))
then
Must_Inline := True;
-- If we are compiling a package body that is not the main
-- unit, it must be for inlining/instantiation purposes,
-- in which case we inline the call to insure that the same
-- temporaries are generated when compiling the body by
-- itself. Otherwise link errors can occur.
-- If the function being called is itself in the main unit,
-- we cannot inline, because there is a risk of double
-- elaboration and/or circularity: the inlining can make
-- visible a private entity in the body of the main unit,
-- that gigi will see before its sees its proper definition.
elsif not (In_Extended_Main_Code_Unit (N))
and then In_Package_Body
then
Must_Inline := not In_Extended_Main_Source_Unit (Subp);
end if;
end if;
if Must_Inline then
Expand_Inlined_Call (N, Subp, Orig_Subp);
else
-- Let the back end handle it
Add_Inlined_Body (Subp);
if Front_End_Inlining
and then Nkind (Spec) = N_Subprogram_Declaration
and then (In_Extended_Main_Code_Unit (N))
and then No (Body_To_Inline (Spec))
and then not Has_Completion (Subp)
and then In_Same_Extended_Unit (Sloc (Spec), Loc)
then
Cannot_Inline
("cannot inline& (body not seen yet)?",
N, Subp);
end if;
end if;
end Inlined_Subprogram;
end if;
end if;
-- Check for a protected subprogram. This is either an intra-object
-- call, or a protected function call. Protected procedure calls are
-- rewritten as entry calls and handled accordingly.
-- In Ada 2005, this may be an indirect call to an access parameter
-- that is an access_to_subprogram. In that case the anonymous type
-- has a scope that is a protected operation, but the call is a
-- regular one.
Scop := Scope (Subp);
if Nkind (N) /= N_Entry_Call_Statement
and then Is_Protected_Type (Scop)
and then Ekind (Subp) /= E_Subprogram_Type
then
-- If the call is an internal one, it is rewritten as a call to
-- to the corresponding unprotected subprogram.
Expand_Protected_Subprogram_Call (N, Subp, Scop);
end if;
-- Functions returning controlled objects need special attention
if Controlled_Type (Etype (Subp))
and then not Is_Return_By_Reference_Type (Etype (Subp))
then
Expand_Ctrl_Function_Call (N);
end if;
-- Test for First_Optional_Parameter, and if so, truncate parameter
-- list if there are optional parameters at the trailing end.
-- Note we never delete procedures for call via a pointer.
if (Ekind (Subp) = E_Procedure or else Ekind (Subp) = E_Function)
and then Present (First_Optional_Parameter (Subp))
then
declare
Last_Keep_Arg : Node_Id;
begin
-- Last_Keep_Arg will hold the last actual that should be
-- retained. If it remains empty at the end, it means that
-- all parameters are optional.
Last_Keep_Arg := Empty;
-- Find first optional parameter, must be present since we
-- checked the validity of the parameter before setting it.
Formal := First_Formal (Subp);
Actual := First_Actual (N);
while Formal /= First_Optional_Parameter (Subp) loop
Last_Keep_Arg := Actual;
Next_Formal (Formal);
Next_Actual (Actual);
end loop;
-- We have Formal and Actual pointing to the first potentially
-- droppable argument. We can drop all the trailing arguments
-- whose actual matches the default. Note that we know that all
-- remaining formals have defaults, because we checked that this
-- requirement was met before setting First_Optional_Parameter.
-- We use Fully_Conformant_Expressions to check for identity
-- between formals and actuals, which may miss some cases, but
-- on the other hand, this is only an optimization (if we fail
-- to truncate a parameter it does not affect functionality).
-- So if the default is 3 and the actual is 1+2, we consider
-- them unequal, which hardly seems worrisome.
while Present (Formal) loop
if not Fully_Conformant_Expressions
(Actual, Default_Value (Formal))
then
Last_Keep_Arg := Actual;
end if;
Next_Formal (Formal);
Next_Actual (Actual);
end loop;
-- If no arguments, delete entire list, this is the easy case
if No (Last_Keep_Arg) then
while Is_Non_Empty_List (Parameter_Associations (N)) loop
Delete_Tree (Remove_Head (Parameter_Associations (N)));
end loop;
Set_Parameter_Associations (N, No_List);
Set_First_Named_Actual (N, Empty);
-- Case where at the last retained argument is positional. This
-- is also an easy case, since the retained arguments are already
-- in the right form, and we don't need to worry about the order
-- of arguments that get eliminated.
elsif Is_List_Member (Last_Keep_Arg) then
while Present (Next (Last_Keep_Arg)) loop
Delete_Tree (Remove_Next (Last_Keep_Arg));
end loop;
Set_First_Named_Actual (N, Empty);
-- This is the annoying case where the last retained argument
-- is a named parameter. Since the original arguments are not
-- in declaration order, we may have to delete some fairly
-- random collection of arguments.
else
declare
Temp : Node_Id;
Passoc : Node_Id;
Discard : Node_Id;
pragma Warnings (Off, Discard);
begin
-- First step, remove all the named parameters from the
-- list (they are still chained using First_Named_Actual
-- and Next_Named_Actual, so we have not lost them!)
Temp := First (Parameter_Associations (N));
-- Case of all parameters named, remove them all
if Nkind (Temp) = N_Parameter_Association then
while Is_Non_Empty_List (Parameter_Associations (N)) loop
Temp := Remove_Head (Parameter_Associations (N));
end loop;
-- Case of mixed positional/named, remove named parameters
else
while Nkind (Next (Temp)) /= N_Parameter_Association loop
Next (Temp);
end loop;
while Present (Next (Temp)) loop
-- LLVM local
Remove (Next (Temp));
end loop;
end if;
-- Now we loop through the named parameters, till we get
-- to the last one to be retained, adding them to the list.
-- Note that the Next_Named_Actual list does not need to be
-- touched since we are only reordering them on the actual
-- parameter association list.
Passoc := Parent (First_Named_Actual (N));
loop
Temp := Relocate_Node (Passoc);
Append_To
(Parameter_Associations (N), Temp);
exit when
Last_Keep_Arg = Explicit_Actual_Parameter (Passoc);
Passoc := Parent (Next_Named_Actual (Passoc));
end loop;
Set_Next_Named_Actual (Temp, Empty);
loop
Temp := Next_Named_Actual (Passoc);
exit when No (Temp);
Set_Next_Named_Actual
(Passoc, Next_Named_Actual (Parent (Temp)));
Delete_Tree (Temp);
end loop;
end;
end if;
end;
end if;
-- Special processing for Ada 2005 AI-329, which requires a call to
-- Raise_Exception to raise Constraint_Error if the Exception_Id is
-- null. Note that we never need to do this in GNAT mode, or if the
-- parameter to Raise_Exception is a use of Identity, since in these
-- cases we know that the parameter is never null.
if Ada_Version >= Ada_05
and then not GNAT_Mode
and then Is_RTE (Subp, RE_Raise_Exception)
and then (Nkind (First_Actual (N)) /= N_Attribute_Reference
or else Attribute_Name (First_Actual (N)) /= Name_Identity)
then
declare
RCE : constant Node_Id :=
Make_Raise_Constraint_Error (Loc,
Reason => CE_Null_Exception_Id);
begin
Insert_After (N, RCE);
Analyze (RCE);
end;
end if;
end Expand_Call;
--------------------------
-- Expand_Inlined_Call --
--------------------------
procedure Expand_Inlined_Call
(N : Node_Id;
Subp : Entity_Id;
Orig_Subp : Entity_Id)
is
Loc : constant Source_Ptr := Sloc (N);
Is_Predef : constant Boolean :=
Is_Predefined_File_Name
(Unit_File_Name (Get_Source_Unit (Subp)));
Orig_Bod : constant Node_Id :=
Body_To_Inline (Unit_Declaration_Node (Subp));
Blk : Node_Id;
Bod : Node_Id;
Decl : Node_Id;
Decls : constant List_Id := New_List;
Exit_Lab : Entity_Id := Empty;
F : Entity_Id;
A : Node_Id;
Lab_Decl : Node_Id;
Lab_Id : Node_Id;
New_A : Node_Id;
Num_Ret : Int := 0;
Ret_Type : Entity_Id;
Targ : Node_Id;
Targ1 : Node_Id;
Temp : Entity_Id;
Temp_Typ : Entity_Id;
Is_Unc : constant Boolean :=
Is_Array_Type (Etype (Subp))
and then not Is_Constrained (Etype (Subp));
-- If the type returned by the function is unconstrained and the
-- call can be inlined, special processing is required.
procedure Find_Result;
-- For a function that returns an unconstrained type, retrieve the
-- name of the single variable that is the expression of a return
-- statement in the body of the function. Build_Body_To_Inline has
-- verified that this variable is unique, even in the presence of
-- multiple return statements.
procedure Make_Exit_Label;
-- Build declaration for exit label to be used in Return statements
function Process_Formals (N : Node_Id) return Traverse_Result;
-- Replace occurrence of a formal with the corresponding actual, or
-- the thunk generated for it.
function Process_Sloc (Nod : Node_Id) return Traverse_Result;
-- If the call being expanded is that of an internal subprogram,
-- set the sloc of the generated block to that of the call itself,
-- so that the expansion is skipped by the -next- command in gdb.
-- Same processing for a subprogram in a predefined file, e.g.
-- Ada.Tags. If Debug_Generated_Code is true, suppress this change
-- to simplify our own development.
procedure Rewrite_Function_Call (N : Node_Id; Blk : Node_Id);
-- If the function body is a single expression, replace call with
-- expression, else insert block appropriately.
procedure Rewrite_Procedure_Call (N : Node_Id; Blk : Node_Id);
-- If procedure body has no local variables, inline body without
-- creating block, otherwise rewrite call with block.
function Formal_Is_Used_Once (Formal : Entity_Id) return Boolean;
-- Determine whether a formal parameter is used only once in Orig_Bod
-----------------
-- Find_Result --
-----------------
procedure Find_Result is
Decl : Node_Id;
Id : Node_Id;
function Get_Return (N : Node_Id) return Traverse_Result;
-- Recursive function to locate return statements in body.
function Get_Return (N : Node_Id) return Traverse_Result is
begin
if Nkind (N) = N_Return_Statement then
Id := Expression (N);
return Abandon;
else
return OK;
end if;
end Get_Return;
procedure Find_It is new Traverse_Proc (Get_Return);
-- Start of processing for Find_Result
begin
Find_It (Handled_Statement_Sequence (Orig_Bod));
-- At this point the body is unanalyzed. Traverse the list of
-- declarations to locate the defining_identifier for it.
Decl := First (Declarations (Blk));
while Present (Decl) loop
if Chars (Defining_Identifier (Decl)) = Chars (Id) then
Targ1 := Defining_Identifier (Decl);
exit;
else
Next (Decl);
end if;
end loop;
end Find_Result;
---------------------
-- Make_Exit_Label --
---------------------
procedure Make_Exit_Label is
begin
-- Create exit label for subprogram if one does not exist yet
if No (Exit_Lab) then
Lab_Id := Make_Identifier (Loc, New_Internal_Name ('L'));
Set_Entity (Lab_Id,
Make_Defining_Identifier (Loc, Chars (Lab_Id)));
Exit_Lab := Make_Label (Loc, Lab_Id);
Lab_Decl :=
Make_Implicit_Label_Declaration (Loc,
Defining_Identifier => Entity (Lab_Id),
Label_Construct => Exit_Lab);
end if;
end Make_Exit_Label;
---------------------
-- Process_Formals --
---------------------
function Process_Formals (N : Node_Id) return Traverse_Result is
A : Entity_Id;
E : Entity_Id;
Ret : Node_Id;
begin
if Is_Entity_Name (N)
and then Present (Entity (N))
then
E := Entity (N);
if Is_Formal (E)
and then Scope (E) = Subp
then
A := Renamed_Object (E);
if Is_Entity_Name (A) then
Rewrite (N, New_Occurrence_Of (Entity (A), Loc));
elsif Nkind (A) = N_Defining_Identifier then
Rewrite (N, New_Occurrence_Of (A, Loc));
else -- numeric literal
Rewrite (N, New_Copy (A));
end if;
end if;
return Skip;
elsif Nkind (N) = N_Return_Statement then
if No (Expression (N)) then
Make_Exit_Label;
Rewrite (N, Make_Goto_Statement (Loc,
Name => New_Copy (Lab_Id)));
else
if Nkind (Parent (N)) = N_Handled_Sequence_Of_Statements
and then Nkind (Parent (Parent (N))) = N_Subprogram_Body
then
-- Function body is a single expression. No need for
-- exit label.
null;
else
Num_Ret := Num_Ret + 1;
Make_Exit_Label;
end if;
-- Because of the presence of private types, the views of the
-- expression and the context may be different, so place an
-- unchecked conversion to the context type to avoid spurious
-- errors, eg. when the expression is a numeric literal and
-- the context is private. If the expression is an aggregate,
-- use a qualified expression, because an aggregate is not a
-- legal argument of a conversion.
if Nkind (Expression (N)) = N_Aggregate
or else Nkind (Expression (N)) = N_Null
then
Ret :=
Make_Qualified_Expression (Sloc (N),
Subtype_Mark => New_Occurrence_Of (Ret_Type, Sloc (N)),
Expression => Relocate_Node (Expression (N)));
else
Ret :=
Unchecked_Convert_To
(Ret_Type, Relocate_Node (Expression (N)));
end if;
if Nkind (Targ) = N_Defining_Identifier then
Rewrite (N,
Make_Assignment_Statement (Loc,
Name => New_Occurrence_Of (Targ, Loc),
Expression => Ret));
else
Rewrite (N,
Make_Assignment_Statement (Loc,
Name => New_Copy (Targ),
Expression => Ret));
end if;
Set_Assignment_OK (Name (N));
if Present (Exit_Lab) then
Insert_After (N,
Make_Goto_Statement (Loc,
Name => New_Copy (Lab_Id)));
end if;
end if;
return OK;
-- Remove pragma Unreferenced since it may refer to formals that
-- are not visible in the inlined body, and in any case we will
-- not be posting warnings on the inlined body so it is unneeded.
elsif Nkind (N) = N_Pragma
and then Chars (N) = Name_Unreferenced
then
Rewrite (N, Make_Null_Statement (Sloc (N)));
return OK;
else
return OK;
end if;
end Process_Formals;
procedure Replace_Formals is new Traverse_Proc (Process_Formals);
------------------
-- Process_Sloc --
------------------
function Process_Sloc (Nod : Node_Id) return Traverse_Result is
begin
if not Debug_Generated_Code then
Set_Sloc (Nod, Sloc (N));
Set_Comes_From_Source (Nod, False);
end if;
return OK;
end Process_Sloc;
procedure Reset_Slocs is new Traverse_Proc (Process_Sloc);
---------------------------
-- Rewrite_Function_Call --
---------------------------
procedure Rewrite_Function_Call (N : Node_Id; Blk : Node_Id) is
HSS : constant Node_Id := Handled_Statement_Sequence (Blk);
Fst : constant Node_Id := First (Statements (HSS));
begin
-- Optimize simple case: function body is a single return statement,
-- which has been expanded into an assignment.
if Is_Empty_List (Declarations (Blk))
and then Nkind (Fst) = N_Assignment_Statement
and then No (Next (Fst))
then
-- The function call may have been rewritten as the temporary
-- that holds the result of the call, in which case remove the
-- now useless declaration.
if Nkind (N) = N_Identifier
and then Nkind (Parent (Entity (N))) = N_Object_Declaration
then
Rewrite (Parent (Entity (N)), Make_Null_Statement (Loc));
end if;
Rewrite (N, Expression (Fst));
elsif Nkind (N) = N_Identifier
and then Nkind (Parent (Entity (N))) = N_Object_Declaration
then
-- The block assigns the result of the call to the temporary
Insert_After (Parent (Entity (N)), Blk);
elsif Nkind (Parent (N)) = N_Assignment_Statement
and then
(Is_Entity_Name (Name (Parent (N)))
or else
(Nkind (Name (Parent (N))) = N_Explicit_Dereference
and then Is_Entity_Name (Prefix (Name (Parent (N))))))
then
-- Replace assignment with the block
declare
Original_Assignment : constant Node_Id := Parent (N);
begin
-- Preserve the original assignment node to keep the complete
-- assignment subtree consistent enough for Analyze_Assignment
-- to proceed (specifically, the original Lhs node must still
-- have an assignment statement as its parent).
-- We cannot rely on Original_Node to go back from the block
-- node to the assignment node, because the assignment might
-- already be a rewrite substitution.
Discard_Node (Relocate_Node (Original_Assignment));
Rewrite (Original_Assignment, Blk);
end;
elsif Nkind (Parent (N)) = N_Object_Declaration then
Set_Expression (Parent (N), Empty);
Insert_After (Parent (N), Blk);
elsif Is_Unc then
Insert_Before (Parent (N), Blk);
end if;
end Rewrite_Function_Call;
----------------------------
-- Rewrite_Procedure_Call --
----------------------------
procedure Rewrite_Procedure_Call (N : Node_Id; Blk : Node_Id) is
HSS : constant Node_Id := Handled_Statement_Sequence (Blk);
begin
if Is_Empty_List (Declarations (Blk)) then
Insert_List_After (N, Statements (HSS));
Rewrite (N, Make_Null_Statement (Loc));
else
Rewrite (N, Blk);
end if;
end Rewrite_Procedure_Call;
-------------------------
-- Formal_Is_Used_Once --
------------------------
function Formal_Is_Used_Once (Formal : Entity_Id) return Boolean is
Use_Counter : Int := 0;
function Count_Uses (N : Node_Id) return Traverse_Result;
-- Traverse the tree and count the uses of the formal parameter.
-- In this case, for optimization purposes, we do not need to
-- continue the traversal once more than one use is encountered.
----------------
-- Count_Uses --
----------------
function Count_Uses (N : Node_Id) return Traverse_Result is
begin
-- The original node is an identifier
if Nkind (N) = N_Identifier
and then Present (Entity (N))
-- Original node's entity points to the one in the copied body
and then Nkind (Entity (N)) = N_Identifier
and then Present (Entity (Entity (N)))
-- The entity of the copied node is the formal parameter
and then Entity (Entity (N)) = Formal
then
Use_Counter := Use_Counter + 1;
if Use_Counter > 1 then
-- Denote more than one use and abandon the traversal
Use_Counter := 2;
return Abandon;
end if;
end if;
return OK;
end Count_Uses;
procedure Count_Formal_Uses is new Traverse_Proc (Count_Uses);
-- Start of processing for Formal_Is_Used_Once
begin
Count_Formal_Uses (Orig_Bod);
return Use_Counter = 1;
end Formal_Is_Used_Once;
-- Start of processing for Expand_Inlined_Call
begin
-- Check for special case of To_Address call, and if so, just do an
-- unchecked conversion instead of expanding the call. Not only is this
-- more efficient, but it also avoids problem with order of elaboration
-- when address clauses are inlined (address expression elaborated at
-- wrong point).
if Subp = RTE (RE_To_Address) then
Rewrite (N,
Unchecked_Convert_To
(RTE (RE_Address),
Relocate_Node (First_Actual (N))));
return;
end if;
-- Check for an illegal attempt to inline a recursive procedure. If the
-- subprogram has parameters this is detected when trying to supply a
-- binding for parameters that already have one. For parameterless
-- subprograms this must be done explicitly.
if In_Open_Scopes (Subp) then
Error_Msg_N ("call to recursive subprogram cannot be inlined?", N);
Set_Is_Inlined (Subp, False);
return;
end if;
if Nkind (Orig_Bod) = N_Defining_Identifier
or else Nkind (Orig_Bod) = N_Defining_Operator_Symbol
then
-- Subprogram is a renaming_as_body. Calls appearing after the
-- renaming can be replaced with calls to the renamed entity
-- directly, because the subprograms are subtype conformant. If
-- the renamed subprogram is an inherited operation, we must redo
-- the expansion because implicit conversions may be needed.
Set_Name (N, New_Occurrence_Of (Orig_Bod, Loc));
if Present (Alias (Orig_Bod)) then
Expand_Call (N);
end if;
return;
end if;
-- Use generic machinery to copy body of inlined subprogram, as if it
-- were an instantiation, resetting source locations appropriately, so
-- that nested inlined calls appear in the main unit.
Save_Env (Subp, Empty);
Set_Copied_Sloc_For_Inlined_Body (N, Defining_Entity (Orig_Bod));
Bod := Copy_Generic_Node (Orig_Bod, Empty, Instantiating => True);
Blk :=
Make_Block_Statement (Loc,
Declarations => Declarations (Bod),
Handled_Statement_Sequence => Handled_Statement_Sequence (Bod));
if No (Declarations (Bod)) then
Set_Declarations (Blk, New_List);
end if;
-- For the unconstrained case, capture the name of the local
-- variable that holds the result.
if Is_Unc then
Find_Result;
end if;
-- If this is a derived function, establish the proper return type
if Present (Orig_Subp)
and then Orig_Subp /= Subp
then
Ret_Type := Etype (Orig_Subp);
else
Ret_Type := Etype (Subp);
end if;
-- Create temporaries for the actuals that are expressions, or that
-- are scalars and require copying to preserve semantics.
F := First_Formal (Subp);
A := First_Actual (N);
while Present (F) loop
if Present (Renamed_Object (F)) then
Error_Msg_N ("cannot inline call to recursive subprogram", N);
return;
end if;
-- If the argument may be a controlling argument in a call within
-- the inlined body, we must preserve its classwide nature to insure
-- that dynamic dispatching take place subsequently. If the formal
-- has a constraint it must be preserved to retain the semantics of
-- the body.
if Is_Class_Wide_Type (Etype (F))
or else (Is_Access_Type (Etype (F))
and then
Is_Class_Wide_Type (Designated_Type (Etype (F))))
then
Temp_Typ := Etype (F);
elsif Base_Type (Etype (F)) = Base_Type (Etype (A))
and then Etype (F) /= Base_Type (Etype (F))
then
Temp_Typ := Etype (F);
else
Temp_Typ := Etype (A);
end if;
-- If the actual is a simple name or a literal, no need to
-- create a temporary, object can be used directly.
if (Is_Entity_Name (A)
and then
(not Is_Scalar_Type (Etype (A))
or else Ekind (Entity (A)) = E_Enumeration_Literal))
-- When the actual is an identifier and the corresponding formal
-- is used only once in the original body, the formal can be
-- substituted directly with the actual parameter.
or else (Nkind (A) = N_Identifier
and then Formal_Is_Used_Once (F))
or else Nkind (A) = N_Real_Literal
or else Nkind (A) = N_Integer_Literal
or else Nkind (A) = N_Character_Literal
then
if Etype (F) /= Etype (A) then
Set_Renamed_Object
(F, Unchecked_Convert_To (Etype (F), Relocate_Node (A)));
else
Set_Renamed_Object (F, A);
end if;
else
Temp :=
Make_Defining_Identifier (Loc,
Chars => New_Internal_Name ('C'));
-- If the actual for an in/in-out parameter is a view conversion,
-- make it into an unchecked conversion, given that an untagged
-- type conversion is not a proper object for a renaming.
-- In-out conversions that involve real conversions have already
-- been transformed in Expand_Actuals.
if Nkind (A) = N_Type_Conversion
and then Ekind (F) /= E_In_Parameter
then
New_A := Make_Unchecked_Type_Conversion (Loc,
Subtype_Mark => New_Occurrence_Of (Etype (F), Loc),
Expression => Relocate_Node (Expression (A)));
elsif Etype (F) /= Etype (A) then
New_A := Unchecked_Convert_To (Etype (F), Relocate_Node (A));
Temp_Typ := Etype (F);
else
New_A := Relocate_Node (A);
end if;
Set_Sloc (New_A, Sloc (N));
if Ekind (F) = E_In_Parameter
and then not Is_Limited_Type (Etype (A))
then
Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Temp,
Constant_Present => True,
Object_Definition => New_Occurrence_Of (Temp_Typ, Loc),
Expression => New_A);
else
Decl :=
Make_Object_Renaming_Declaration (Loc,
Defining_Identifier => Temp,
Subtype_Mark => New_Occurrence_Of (Temp_Typ, Loc),
Name => New_A);
end if;
Append (Decl, Decls);
Set_Renamed_Object (F, Temp);
end if;
Next_Formal (F);
Next_Actual (A);
end loop;
-- Establish target of function call. If context is not assignment or
-- declaration, create a temporary as a target. The declaration for
-- the temporary may be subsequently optimized away if the body is a
-- single expression, or if the left-hand side of the assignment is
-- simple enough, i.e. an entity or an explicit dereference of one.
if Ekind (Subp) = E_Function then
if Nkind (Parent (N)) = N_Assignment_Statement
and then Is_Entity_Name (Name (Parent (N)))
then
Targ := Name (Parent (N));
elsif Nkind (Parent (N)) = N_Assignment_Statement
and then Nkind (Name (Parent (N))) = N_Explicit_Dereference
and then Is_Entity_Name (Prefix (Name (Parent (N))))
then
Targ := Name (Parent (N));
else
-- Replace call with temporary and create its declaration
Temp :=
Make_Defining_Identifier (Loc, New_Internal_Name ('C'));
Set_Is_Internal (Temp);
-- For the unconstrained case. the generated temporary has the
-- same constrained declaration as the result variable.
-- It may eventually be possible to remove that temporary and
-- use the result variable directly.
if Is_Unc then
Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Temp,
Object_Definition =>
New_Copy_Tree (Object_Definition (Parent (Targ1))));
Replace_Formals (Decl);
else
Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Temp,
Object_Definition =>
New_Occurrence_Of (Ret_Type, Loc));
Set_Etype (Temp, Ret_Type);
end if;
Set_No_Initialization (Decl);
Append (Decl, Decls);
Rewrite (N, New_Occurrence_Of (Temp, Loc));
Targ := Temp;
end if;
end if;
Insert_Actions (N, Decls);
-- Traverse the tree and replace formals with actuals or their thunks.
-- Attach block to tree before analysis and rewriting.
Replace_Formals (Blk);
Set_Parent (Blk, N);
if not Comes_From_Source (Subp)
or else Is_Predef
then
Reset_Slocs (Blk);
end if;
if Present (Exit_Lab) then
-- If the body was a single expression, the single return statement
-- and the corresponding label are useless.
if Num_Ret = 1
and then
Nkind (Last (Statements (Handled_Statement_Sequence (Blk)))) =
N_Goto_Statement
then
Remove (Last (Statements (Handled_Statement_Sequence (Blk))));
else
Append (Lab_Decl, (Declarations (Blk)));
Append (Exit_Lab, Statements (Handled_Statement_Sequence (Blk)));
end if;
end if;
-- Analyze Blk with In_Inlined_Body set, to avoid spurious errors on
-- conflicting private views that Gigi would ignore. If this is
-- predefined unit, analyze with checks off, as is done in the non-
-- inlined run-time units.
declare
I_Flag : constant Boolean := In_Inlined_Body;
begin
In_Inlined_Body := True;
if Is_Predef then
declare
Style : constant Boolean := Style_Check;
begin
Style_Check := False;
Analyze (Blk, Suppress => All_Checks);
Style_Check := Style;
end;
else
Analyze (Blk);
end if;
In_Inlined_Body := I_Flag;
end;
if Ekind (Subp) = E_Procedure then
Rewrite_Procedure_Call (N, Blk);
else
Rewrite_Function_Call (N, Blk);
-- For the unconstrained case, the replacement of the call has been
-- made prior to the complete analysis of the generated declarations.
-- Propagate the proper type now.
if Is_Unc then
if Nkind (N) = N_Identifier then
Set_Etype (N, Etype (Entity (N)));
else
Set_Etype (N, Etype (Targ1));
end if;
end if;
end if;
Restore_Env;
-- Cleanup mapping between formals and actuals for other expansions
F := First_Formal (Subp);
while Present (F) loop
Set_Renamed_Object (F, Empty);
Next_Formal (F);
end loop;
end Expand_Inlined_Call;
----------------------------
-- Expand_N_Function_Call --
----------------------------
procedure Expand_N_Function_Call (N : Node_Id) is
Typ : constant Entity_Id := Etype (N);
function Returned_By_Reference return Boolean;
-- If the return type is returned through the secondary stack. that is
-- by reference, we don't want to create a temp to force stack checking.
-- Shouldn't this function be moved to exp_util???
function Rhs_Of_Assign_Or_Decl (N : Node_Id) return Boolean;
-- If the call is the right side of an assignment or the expression in
-- an object declaration, we don't need to create a temp as the left
-- side will already trigger stack checking if necessary.
--
-- If the call is a component in an extension aggregate, it will be
-- expanded into assignments as well, so no temporary is needed. This
-- also solves the problem of functions returning types with unknown
-- discriminants, where it is not possible to declare an object of the
-- type altogether.
---------------------------
-- Returned_By_Reference --
---------------------------
function Returned_By_Reference return Boolean is
S : Entity_Id;
begin
if Is_Return_By_Reference_Type (Typ) then
return True;
elsif Nkind (Parent (N)) /= N_Return_Statement then
return False;
elsif Requires_Transient_Scope (Typ) then
-- Verify that the return type of the enclosing function has the
-- same constrained status as that of the expression.
S := Current_Scope;
while Ekind (S) /= E_Function loop
S := Scope (S);
end loop;
return Is_Constrained (Typ) = Is_Constrained (Etype (S));
else
return False;
end if;
end Returned_By_Reference;
---------------------------
-- Rhs_Of_Assign_Or_Decl --
---------------------------
function Rhs_Of_Assign_Or_Decl (N : Node_Id) return Boolean is
begin
if (Nkind (Parent (N)) = N_Assignment_Statement
and then Expression (Parent (N)) = N)
or else
(Nkind (Parent (N)) = N_Qualified_Expression
and then Nkind (Parent (Parent (N))) = N_Assignment_Statement
and then Expression (Parent (Parent (N))) = Parent (N))
or else
(Nkind (Parent (N)) = N_Object_Declaration
and then Expression (Parent (N)) = N)
or else
(Nkind (Parent (N)) = N_Component_Association
and then Expression (Parent (N)) = N
and then Nkind (Parent (Parent (N))) = N_Aggregate
and then Rhs_Of_Assign_Or_Decl (Parent (Parent (N))))
or else
(Nkind (Parent (N)) = N_Extension_Aggregate
and then Is_Private_Type (Etype (Typ)))
then
return True;
else
return False;
end if;
end Rhs_Of_Assign_Or_Decl;
-- Start of processing for Expand_N_Function_Call
begin
-- A special check. If stack checking is enabled, and the return type
-- might generate a large temporary, and the call is not the right side
-- of an assignment, then generate an explicit temporary. We do this
-- because otherwise gigi may generate a large temporary on the fly and
-- this can cause trouble with stack checking.
-- This is unecessary if the call is the expression in an object
-- declaration, or if it appears outside of any library unit. This can
-- only happen if it appears as an actual in a library-level instance,
-- in which case a temporary will be generated for it once the instance
-- itself is installed.
if May_Generate_Large_Temp (Typ)
and then not Rhs_Of_Assign_Or_Decl (N)
and then not Returned_By_Reference
and then Current_Scope /= Standard_Standard
then
if Stack_Checking_Enabled then
-- Note: it might be thought that it would be OK to use a call to
-- Force_Evaluation here, but that's not good enough, because
-- that can results in a 'Reference construct that may still need
-- a temporary.
declare
Loc : constant Source_Ptr := Sloc (N);
Temp_Obj : constant Entity_Id :=
Make_Defining_Identifier (Loc,
Chars => New_Internal_Name ('F'));
Temp_Typ : Entity_Id := Typ;
Decl : Node_Id;
A : Node_Id;
F : Entity_Id;
Proc : Entity_Id;
begin
if Is_Tagged_Type (Typ)
and then Present (Controlling_Argument (N))
then
if Nkind (Parent (N)) /= N_Procedure_Call_Statement
and then Nkind (Parent (N)) /= N_Function_Call
then
-- If this is a tag-indeterminate call, the object must
-- be classwide.
if Is_Tag_Indeterminate (N) then
Temp_Typ := Class_Wide_Type (Typ);
end if;
else
-- If this is a dispatching call that is itself the
-- controlling argument of an enclosing call, the
-- nominal subtype of the object that replaces it must
-- be classwide, so that dispatching will take place
-- properly. If it is not a controlling argument, the
-- object is not classwide.
Proc := Entity (Name (Parent (N)));
F := First_Formal (Proc);
A := First_Actual (Parent (N));
while A /= N loop
Next_Formal (F);
Next_Actual (A);
end loop;
if Is_Controlling_Formal (F) then
Temp_Typ := Class_Wide_Type (Typ);
end if;
end if;
end if;
Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Temp_Obj,
Object_Definition => New_Occurrence_Of (Temp_Typ, Loc),
Constant_Present => True,
Expression => Relocate_Node (N));
Set_Assignment_OK (Decl);
Insert_Actions (N, New_List (Decl));
Rewrite (N, New_Occurrence_Of (Temp_Obj, Loc));
end;
else
-- If stack-checking is not enabled, increment serial number
-- for internal names, so that subsequent symbols are consistent
-- with and without stack-checking.
Synchronize_Serial_Number;
-- Now we can expand the call with consistent symbol names
Expand_Call (N);
end if;
-- Normal case, expand the call
else
Expand_Call (N);
end if;
end Expand_N_Function_Call;
---------------------------------------
-- Expand_N_Procedure_Call_Statement --
---------------------------------------
procedure Expand_N_Procedure_Call_Statement (N : Node_Id) is
begin
Expand_Call (N);
end Expand_N_Procedure_Call_Statement;
------------------------------
-- Expand_N_Subprogram_Body --
------------------------------
-- Add poll call if ATC polling is enabled, unless the body will be
-- inlined by the back-end.
-- Add return statement if last statement in body is not a return statement
-- (this makes things easier on Gigi which does not want to have to handle
-- a missing return).
-- Add call to Activate_Tasks if body is a task activator
-- Deal with possible detection of infinite recursion
-- Eliminate body completely if convention stubbed
-- Encode entity names within body, since we will not need to reference
-- these entities any longer in the front end.
-- Initialize scalar out parameters if Initialize/Normalize_Scalars
-- Reset Pure indication if any parameter has root type System.Address
-- Wrap thread body
procedure Expand_N_Subprogram_Body (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
H : constant Node_Id := Handled_Statement_Sequence (N);
Body_Id : Entity_Id;
Spec_Id : Entity_Id;
Except_H : Node_Id;
Scop : Entity_Id;
Dec : Node_Id;
Next_Op : Node_Id;
L : List_Id;
procedure Add_Return (S : List_Id);
-- Append a return statement to the statement sequence S if the last
-- statement is not already a return or a goto statement. Note that
-- the latter test is not critical, it does not matter if we add a
-- few extra returns, since they get eliminated anyway later on.
procedure Expand_Thread_Body;
-- Perform required expansion of a thread body
----------------
-- Add_Return --
----------------
procedure Add_Return (S : List_Id) is
begin
if not Is_Transfer (Last (S)) then
-- The source location for the return is the end label
-- of the procedure in all cases. This is a bit odd when
-- there are exception handlers, but not much else we can do.
Append_To (S, Make_Return_Statement (Sloc (End_Label (H))));
end if;
end Add_Return;
------------------------
-- Expand_Thread_Body --
------------------------
-- The required expansion of a thread body is as follows
-- procedure <thread body procedure name> is
-- _Secondary_Stack : aliased
-- Storage_Elements.Storage_Array
-- (1 .. Storage_Offset (Sec_Stack_Size));
-- for _Secondary_Stack'Alignment use Standard'Maximum_Alignment;
-- _Process_ATSD : aliased System.Threads.ATSD;
-- begin
-- System.Threads.Thread_Body_Enter;
-- (_Secondary_Stack'Address,
-- _Secondary_Stack'Length,
-- _Process_ATSD'Address);
-- declare
-- <user declarations>
-- begin
-- <user statements>
-- <user exception handlers>
-- end;
-- System.Threads.Thread_Body_Leave;
-- exception
-- when E : others =>
-- System.Threads.Thread_Body_Exceptional_Exit (E);
-- end;
-- Note the exception handler is omitted if pragma Restriction
-- No_Exception_Handlers is currently active.
procedure Expand_Thread_Body is
User_Decls : constant List_Id := Declarations (N);
Sec_Stack_Len : Node_Id;
TB_Pragma : constant Node_Id :=
Get_Rep_Pragma (Spec_Id, Name_Thread_Body);
Ent_SS : Entity_Id;
Ent_ATSD : Entity_Id;
Ent_EO : Entity_Id;
Decl_SS : Node_Id;
Decl_ATSD : Node_Id;
Excep_Handlers : List_Id;
begin
New_Scope (Spec_Id);
-- Get proper setting for secondary stack size
if List_Length (Pragma_Argument_Associations (TB_Pragma)) = 2 then
Sec_Stack_Len :=
Expression (Last (Pragma_Argument_Associations (TB_Pragma)));
else
Sec_Stack_Len :=
New_Occurrence_Of (RTE (RE_Default_Secondary_Stack_Size), Loc);
end if;
Sec_Stack_Len := Convert_To (RTE (RE_Storage_Offset), Sec_Stack_Len);
-- Build and set declarations for the wrapped thread body
Ent_SS := Make_Defining_Identifier (Loc, Name_uSecondary_Stack);
Ent_ATSD := Make_Defining_Identifier (Loc, Name_uProcess_ATSD);
Decl_SS :=
Make_Object_Declaration (Loc,
Defining_Identifier => Ent_SS,
Aliased_Present => True,
Object_Definition =>
Make_Subtype_Indication (Loc,
Subtype_Mark =>
New_Occurrence_Of (RTE (RE_Storage_Array), Loc),
Constraint =>
Make_Index_Or_Discriminant_Constraint (Loc,
Constraints => New_List (
Make_Range (Loc,
Low_Bound => Make_Integer_Literal (Loc, 1),
High_Bound => Sec_Stack_Len)))));
Decl_ATSD :=
Make_Object_Declaration (Loc,
Defining_Identifier => Ent_ATSD,
Aliased_Present => True,
Object_Definition => New_Occurrence_Of (RTE (RE_ATSD), Loc));
Set_Declarations (N, New_List (Decl_SS, Decl_ATSD));
Analyze (Decl_SS);
Analyze (Decl_ATSD);
Set_Alignment (Ent_SS, UI_From_Int (Maximum_Alignment));
-- Create new exception handler
if Restriction_Active (No_Exception_Handlers) then
Excep_Handlers := No_List;
else
Check_Restriction (No_Exception_Handlers, N);
Ent_EO := Make_Defining_Identifier (Loc, Name_uE);
Excep_Handlers := New_List (
Make_Exception_Handler (Loc,
Choice_Parameter => Ent_EO,
Exception_Choices => New_List (
Make_Others_Choice (Loc)),
Statements => New_List (
Make_Procedure_Call_Statement (Loc,
Name =>
New_Occurrence_Of
(RTE (RE_Thread_Body_Exceptional_Exit), Loc),
Parameter_Associations => New_List (
New_Occurrence_Of (Ent_EO, Loc))))));
end if;
-- Now build new handled statement sequence and analyze it
Set_Handled_Statement_Sequence (N,
Make_Handled_Sequence_Of_Statements (Loc,
Statements => New_List (
Make_Procedure_Call_Statement (Loc,
Name => New_Occurrence_Of (RTE (RE_Thread_Body_Enter), Loc),
Parameter_Associations => New_List (
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Ent_SS, Loc),
Attribute_Name => Name_Address),
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Ent_SS, Loc),
Attribute_Name => Name_Length),
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Ent_ATSD, Loc),
Attribute_Name => Name_Address))),
Make_Block_Statement (Loc,
Declarations => User_Decls,
Handled_Statement_Sequence => H),
Make_Procedure_Call_Statement (Loc,
Name => New_Occurrence_Of (RTE (RE_Thread_Body_Leave), Loc))),
Exception_Handlers => Excep_Handlers));
Analyze (Handled_Statement_Sequence (N));
End_Scope;
end Expand_Thread_Body;
-- Start of processing for Expand_N_Subprogram_Body
begin
-- Set L to either the list of declarations if present, or
-- to the list of statements if no declarations are present.
-- This is used to insert new stuff at the start.
if Is_Non_Empty_List (Declarations (N)) then
L := Declarations (N);
else
L := Statements (Handled_Statement_Sequence (N));
end if;
-- Find entity for subprogram
Body_Id := Defining_Entity (N);
if Present (Corresponding_Spec (N)) then
Spec_Id := Corresponding_Spec (N);
else
Spec_Id := Body_Id;
end if;
-- Need poll on entry to subprogram if polling enabled. We only
-- do this for non-empty subprograms, since it does not seem
-- necessary to poll for a dummy null subprogram. Do not add polling
-- point if calls to this subprogram will be inlined by the back-end,
-- to avoid repeated polling points in nested inlinings.
if Is_Non_Empty_List (L) then
if Is_Inlined (Spec_Id)
and then Front_End_Inlining
and then Optimization_Level > 1
then
null;
else
Generate_Poll_Call (First (L));
end if;
end if;
-- If this is a Pure function which has any parameters whose root
-- type is System.Address, reset the Pure indication, since it will
-- likely cause incorrect code to be generated as the parameter is
-- probably a pointer, and the fact that the same pointer is passed
-- does not mean that the same value is being referenced.
-- Note that if the programmer gave an explicit Pure_Function pragma,
-- then we believe the programmer, and leave the subprogram Pure.
-- This code should probably be at the freeze point, so that it
-- happens even on a -gnatc (or more importantly -gnatt) compile
-- so that the semantic tree has Is_Pure set properly ???
if Is_Pure (Spec_Id)
and then Is_Subprogram (Spec_Id)
and then not Has_Pragma_Pure_Function (Spec_Id)
then
declare
F : Entity_Id;
begin
F := First_Formal (Spec_Id);
while Present (F) loop
if Is_Descendent_Of_Address (Etype (F)) then
Set_Is_Pure (Spec_Id, False);
if Spec_Id /= Body_Id then
Set_Is_Pure (Body_Id, False);
end if;
exit;
end if;
Next_Formal (F);
end loop;
end;
end if;
-- Initialize any scalar OUT args if Initialize/Normalize_Scalars
if Init_Or_Norm_Scalars and then Is_Subprogram (Spec_Id) then
declare
F : Entity_Id;
V : constant Boolean := Validity_Checks_On;
begin
-- We turn off validity checking, since we do not want any
-- check on the initializing value itself (which we know
-- may well be invalid!)
Validity_Checks_On := False;
-- Loop through formals
F := First_Formal (Spec_Id);
while Present (F) loop
if Is_Scalar_Type (Etype (F))
and then Ekind (F) = E_Out_Parameter
then
Insert_Before_And_Analyze (First (L),
Make_Assignment_Statement (Loc,
Name => New_Occurrence_Of (F, Loc),
Expression => Get_Simple_Init_Val (Etype (F), Loc)));
end if;
Next_Formal (F);
end loop;
Validity_Checks_On := V;
end;
end if;
Scop := Scope (Spec_Id);
-- Add discriminal renamings to protected subprograms. Install new
-- discriminals for expansion of the next subprogram of this protected
-- type, if any.
if Is_List_Member (N)
and then Present (Parent (List_Containing (N)))
and then Nkind (Parent (List_Containing (N))) = N_Protected_Body
then
Add_Discriminal_Declarations
(Declarations (N), Scop, Name_uObject, Loc);
Add_Private_Declarations (Declarations (N), Scop, Name_uObject, Loc);
-- Associate privals and discriminals with the next protected
-- operation body to be expanded. These are used to expand references
-- to private data objects and discriminants, respectively.
Next_Op := Next_Protected_Operation (N);
if Present (Next_Op) then
Dec := Parent (Base_Type (Scop));
Set_Privals (Dec, Next_Op, Loc);
Set_Discriminals (Dec);
end if;
end if;
-- Clear out statement list for stubbed procedure
if Present (Corresponding_Spec (N)) then
Set_Elaboration_Flag (N, Spec_Id);
if Convention (Spec_Id) = Convention_Stubbed
or else Is_Eliminated (Spec_Id)
then
Set_Declarations (N, Empty_List);
Set_Handled_Statement_Sequence (N,
Make_Handled_Sequence_Of_Statements (Loc,
Statements => New_List (
Make_Null_Statement (Loc))));
return;
end if;
end if;
-- Returns_By_Ref flag is normally set when the subprogram is frozen
-- but subprograms with no specs are not frozen.
declare
Typ : constant Entity_Id := Etype (Spec_Id);
Utyp : constant Entity_Id := Underlying_Type (Typ);
begin
if not Acts_As_Spec (N)
and then Nkind (Parent (Parent (Spec_Id))) /=
N_Subprogram_Body_Stub
then
null;
elsif Is_Return_By_Reference_Type (Typ) then
Set_Returns_By_Ref (Spec_Id);
elsif Present (Utyp) and then Controlled_Type (Utyp) then
Set_Returns_By_Ref (Spec_Id);
end if;
end;
-- For a procedure, we add a return for all possible syntactic ends
-- of the subprogram. Note that reanalysis is not necessary in this
-- case since it would require a lot of work and accomplish nothing.
if Ekind (Spec_Id) = E_Procedure
or else Ekind (Spec_Id) = E_Generic_Procedure
then
Add_Return (Statements (H));
if Present (Exception_Handlers (H)) then
Except_H := First_Non_Pragma (Exception_Handlers (H));
while Present (Except_H) loop
Add_Return (Statements (Except_H));
Next_Non_Pragma (Except_H);
end loop;
end if;
-- For a function, we must deal with the case where there is at least
-- one missing return. What we do is to wrap the entire body of the
-- function in a block:
-- begin
-- ...
-- end;
-- becomes
-- begin
-- begin
-- ...
-- end;
-- raise Program_Error;
-- end;
-- This approach is necessary because the raise must be signalled
-- to the caller, not handled by any local handler (RM 6.4(11)).
-- Note: we do not need to analyze the constructed sequence here,
-- since it has no handler, and an attempt to analyze the handled
-- statement sequence twice is risky in various ways (e.g. the
-- issue of expanding cleanup actions twice).
elsif Has_Missing_Return (Spec_Id) then
declare
Hloc : constant Source_Ptr := Sloc (H);
Blok : constant Node_Id :=
Make_Block_Statement (Hloc,
Handled_Statement_Sequence => H);
Rais : constant Node_Id :=
Make_Raise_Program_Error (Hloc,
Reason => PE_Missing_Return);
begin
Set_Handled_Statement_Sequence (N,
Make_Handled_Sequence_Of_Statements (Hloc,
Statements => New_List (Blok, Rais)));
New_Scope (Spec_Id);
Analyze (Blok);
Analyze (Rais);
Pop_Scope;
end;
end if;
-- If subprogram contains a parameterless recursive call, then we may
-- have an infinite recursion, so see if we can generate code to check
-- for this possibility if storage checks are not suppressed.
if Ekind (Spec_Id) = E_Procedure
and then Has_Recursive_Call (Spec_Id)
and then not Storage_Checks_Suppressed (Spec_Id)
then
Detect_Infinite_Recursion (N, Spec_Id);
end if;
-- Finally, if we are in Normalize_Scalars mode, then any scalar out
-- parameters must be initialized to the appropriate default value.
if Ekind (Spec_Id) = E_Procedure and then Normalize_Scalars then
declare
Floc : Source_Ptr;
Formal : Entity_Id;
Stm : Node_Id;
begin
Formal := First_Formal (Spec_Id);
while Present (Formal) loop
Floc := Sloc (Formal);
if Ekind (Formal) = E_Out_Parameter
and then Is_Scalar_Type (Etype (Formal))
then
Stm :=
Make_Assignment_Statement (Floc,
Name => New_Occurrence_Of (Formal, Floc),
Expression =>
Get_Simple_Init_Val (Etype (Formal), Floc));
Prepend (Stm, Declarations (N));
Analyze (Stm);
end if;
Next_Formal (Formal);
end loop;
end;
end if;
-- Deal with thread body
if Is_Thread_Body (Spec_Id) then
Expand_Thread_Body;
end if;
-- Set to encode entity names in package body before gigi is called
Qualify_Entity_Names (N);
end Expand_N_Subprogram_Body;
-----------------------------------
-- Expand_N_Subprogram_Body_Stub --
-----------------------------------
procedure Expand_N_Subprogram_Body_Stub (N : Node_Id) is
begin
if Present (Corresponding_Body (N)) then
Expand_N_Subprogram_Body (
Unit_Declaration_Node (Corresponding_Body (N)));
end if;
end Expand_N_Subprogram_Body_Stub;
-------------------------------------
-- Expand_N_Subprogram_Declaration --
-------------------------------------
-- If the declaration appears within a protected body, it is a private
-- operation of the protected type. We must create the corresponding
-- protected subprogram an associated formals. For a normal protected
-- operation, this is done when expanding the protected type declaration.
-- If the declaration is for a null procedure, emit null body
procedure Expand_N_Subprogram_Declaration (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Subp : constant Entity_Id := Defining_Entity (N);
Scop : constant Entity_Id := Scope (Subp);
Prot_Decl : Node_Id;
Prot_Bod : Node_Id;
Prot_Id : Entity_Id;
begin
-- Deal with case of protected subprogram. Do not generate protected
-- operation if operation is flagged as eliminated.
if Is_List_Member (N)
and then Present (Parent (List_Containing (N)))
and then Nkind (Parent (List_Containing (N))) = N_Protected_Body
and then Is_Protected_Type (Scop)
then
if No (Protected_Body_Subprogram (Subp))
and then not Is_Eliminated (Subp)
then
Prot_Decl :=
Make_Subprogram_Declaration (Loc,
Specification =>
Build_Protected_Sub_Specification
(N, Scop, Unprotected_Mode));
-- The protected subprogram is declared outside of the protected
-- body. Given that the body has frozen all entities so far, we
-- analyze the subprogram and perform freezing actions explicitly.
-- If the body is a subunit, the insertion point is before the
-- stub in the parent.
Prot_Bod := Parent (List_Containing (N));
if Nkind (Parent (Prot_Bod)) = N_Subunit then
Prot_Bod := Corresponding_Stub (Parent (Prot_Bod));
end if;
Insert_Before (Prot_Bod, Prot_Decl);
Prot_Id := Defining_Unit_Name (Specification (Prot_Decl));
New_Scope (Scope (Scop));
Analyze (Prot_Decl);
Create_Extra_Formals (Prot_Id);
Set_Protected_Body_Subprogram (Subp, Prot_Id);
Pop_Scope;
end if;
elsif Nkind (Specification (N)) = N_Procedure_Specification
and then Null_Present (Specification (N))
then
declare
Bod : constant Node_Id :=
Make_Subprogram_Body (Loc,
Specification =>
New_Copy_Tree (Specification (N)),
Declarations => New_List,
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,
Statements => New_List (Make_Null_Statement (Loc))));
begin
Set_Body_To_Inline (N, Bod);
Insert_After (N, Bod);
Analyze (Bod);
-- Corresponding_Spec isn't being set by Analyze_Subprogram_Body,
-- evidently because Set_Has_Completion is called earlier for null
-- procedures in Analyze_Subprogram_Declaration, so we force its
-- setting here. If the setting of Has_Completion is not set
-- earlier, then it can result in missing body errors if other
-- errors were already reported (since expansion is turned off).
-- Should creation of the empty body be moved to the analyzer???
Set_Corresponding_Spec (Bod, Defining_Entity (Specification (N)));
end;
end if;
end Expand_N_Subprogram_Declaration;
---------------------------------------
-- Expand_Protected_Object_Reference --
---------------------------------------
function Expand_Protected_Object_Reference
(N : Node_Id;
Scop : Entity_Id)
return Node_Id
is
Loc : constant Source_Ptr := Sloc (N);
Corr : Entity_Id;
Rec : Node_Id;
Param : Entity_Id;
Proc : Entity_Id;
begin
Rec := Make_Identifier (Loc, Name_uObject);
Set_Etype (Rec, Corresponding_Record_Type (Scop));
-- Find enclosing protected operation, and retrieve its first parameter,
-- which denotes the enclosing protected object. If the enclosing
-- operation is an entry, we are immediately within the protected body,
-- and we can retrieve the object from the service entries procedure. A
-- barrier function has has the same signature as an entry. A barrier
-- function is compiled within the protected object, but unlike
-- protected operations its never needs locks, so that its protected
-- body subprogram points to itself.
Proc := Current_Scope;
while Present (Proc)
and then Scope (Proc) /= Scop
loop
Proc := Scope (Proc);
end loop;
Corr := Protected_Body_Subprogram (Proc);
if No (Corr) then
-- Previous error left expansion incomplete.
-- Nothing to do on this call.
return Empty;
end if;
Param :=
Defining_Identifier
(First (Parameter_Specifications (Parent (Corr))));
if Is_Subprogram (Proc)
and then Proc /= Corr
then
-- Protected function or procedure
Set_Entity (Rec, Param);
-- Rec is a reference to an entity which will not be in scope when
-- the call is reanalyzed, and needs no further analysis.
Set_Analyzed (Rec);
else
-- Entry or barrier function for entry body. The first parameter of
-- the entry body procedure is pointer to the object. We create a
-- local variable of the proper type, duplicating what is done to
-- define _object later on.
declare
Decls : List_Id;
Obj_Ptr : constant Entity_Id := Make_Defining_Identifier (Loc,
Chars =>
New_Internal_Name ('T'));
begin
Decls := New_List (
Make_Full_Type_Declaration (Loc,
Defining_Identifier => Obj_Ptr,
Type_Definition =>
Make_Access_To_Object_Definition (Loc,
Subtype_Indication =>
New_Reference_To
(Corresponding_Record_Type (Scop), Loc))));
Insert_Actions (N, Decls);
Insert_Actions (N, Freeze_Entity (Obj_Ptr, Sloc (N)));
Rec :=
Make_Explicit_Dereference (Loc,
Unchecked_Convert_To (Obj_Ptr,
New_Occurrence_Of (Param, Loc)));
-- Analyze new actual. Other actuals in calls are already analyzed
-- and the list of actuals is not renalyzed after rewriting.
Set_Parent (Rec, N);
Analyze (Rec);
end;
end if;
return Rec;
end Expand_Protected_Object_Reference;
--------------------------------------
-- Expand_Protected_Subprogram_Call --
--------------------------------------
procedure Expand_Protected_Subprogram_Call
(N : Node_Id;
Subp : Entity_Id;
Scop : Entity_Id)
is
Rec : Node_Id;
begin
-- If the protected object is not an enclosing scope, this is
-- an inter-object function call. Inter-object procedure
-- calls are expanded by Exp_Ch9.Build_Simple_Entry_Call.
-- The call is intra-object only if the subprogram being
-- called is in the protected body being compiled, and if the
-- protected object in the call is statically the enclosing type.
-- The object may be an component of some other data structure,
-- in which case this must be handled as an inter-object call.
if not In_Open_Scopes (Scop)
or else not Is_Entity_Name (Name (N))
then
if Nkind (Name (N)) = N_Selected_Component then
Rec := Prefix (Name (N));
else
pragma Assert (Nkind (Name (N)) = N_Indexed_Component);
Rec := Prefix (Prefix (Name (N)));
end if;
Build_Protected_Subprogram_Call (N,
Name => New_Occurrence_Of (Subp, Sloc (N)),
Rec => Convert_Concurrent (Rec, Etype (Rec)),
External => True);
else
Rec := Expand_Protected_Object_Reference (N, Scop);
if No (Rec) then
return;
end if;
Build_Protected_Subprogram_Call (N,
Name => Name (N),
Rec => Rec,
External => False);
end if;
Analyze (N);
-- If it is a function call it can appear in elaboration code and
-- the called entity must be frozen here.
if Ekind (Subp) = E_Function then
Freeze_Expression (Name (N));
end if;
end Expand_Protected_Subprogram_Call;
-----------------------
-- Freeze_Subprogram --
-----------------------
procedure Freeze_Subprogram (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
E : constant Entity_Id := Entity (N);
procedure Check_Overriding_Inherited_Interfaces (E : Entity_Id);
-- (Ada 2005): Check if the primitive E covers some interface already
-- implemented by some ancestor of the tagged-type associated with E.
procedure Register_Interface_DT_Entry
(Prim : Entity_Id;
Ancestor_Iface_Prim : Entity_Id := Empty);
-- (Ada 2005): Register an interface primitive in a secondary dispatch
-- table. If Prim overrides an ancestor primitive of its associated
-- tagged-type then Ancestor_Iface_Prim indicates the entity of that
-- immediate ancestor associated with the interface.
procedure Register_Predefined_DT_Entry (Prim : Entity_Id);
-- (Ada 2005): Register a predefined primitive in all the secondary
-- dispatch tables of its primitive type.
-------------------------------------------
-- Check_Overriding_Inherited_Interfaces --
-------------------------------------------
procedure Check_Overriding_Inherited_Interfaces (E : Entity_Id) is
Typ : Entity_Id;
Elmt : Elmt_Id;
Prim_Op : Entity_Id;
Overriden_Op : Entity_Id := Empty;
begin
if Ada_Version < Ada_05
or else not Is_Overriding_Operation (E)
or else Is_Predefined_Dispatching_Operation (E)
or else Present (Alias (E))
then
return;
end if;
-- Get the entity associated with this primitive operation
Typ := Scope (DTC_Entity (E));
loop
exit when Etype (Typ) = Typ
or else (Present (Full_View (Etype (Typ)))
and then Full_View (Etype (Typ)) = Typ);
-- Climb to the immediate ancestor handling private types
if Present (Full_View (Etype (Typ))) then
Typ := Full_View (Etype (Typ));
else
Typ := Etype (Typ);
end if;
if Present (Abstract_Interfaces (Typ)) then
-- Look for the overriden subprogram in the primary dispatch
-- table of the ancestor.
Overriden_Op := Empty;
Elmt := First_Elmt (Primitive_Operations (Typ));
while Present (Elmt) loop
Prim_Op := Node (Elmt);
if Chars (Prim_Op) = Chars (E)
and then Type_Conformant
(New_Id => Prim_Op,
Old_Id => E,
Skip_Controlling_Formals => True)
and then DT_Position (Prim_Op) = DT_Position (E)
and then Etype (DTC_Entity (Prim_Op)) = RTE (RE_Tag)
and then No (Abstract_Interface_Alias (Prim_Op))
then
if Overriden_Op = Empty then
Overriden_Op := Prim_Op;
-- Additional check to ensure that if two candidates have
-- been found then they refer to the same subprogram.
else
declare
A1 : Entity_Id;
A2 : Entity_Id;
begin
A1 := Overriden_Op;
while Present (Alias (A1)) loop
A1 := Alias (A1);
end loop;
A2 := Prim_Op;
while Present (Alias (A2)) loop
A2 := Alias (A2);
end loop;
if A1 /= A2 then
raise Program_Error;
end if;
end;
end if;
end if;
Next_Elmt (Elmt);
end loop;
-- If not found this is the first overriding of some abstract
-- interface.
if Overriden_Op /= Empty then
-- Find the entries associated with interfaces that are
-- alias of this primitive operation in the ancestor.
Elmt := First_Elmt (Primitive_Operations (Typ));
while Present (Elmt) loop
Prim_Op := Node (Elmt);
if Present (Abstract_Interface_Alias (Prim_Op))
and then Alias (Prim_Op) = Overriden_Op
then
Register_Interface_DT_Entry (E, Prim_Op);
end if;
Next_Elmt (Elmt);
end loop;
end if;
end if;
end loop;
end Check_Overriding_Inherited_Interfaces;
---------------------------------
-- Register_Interface_DT_Entry --
---------------------------------
procedure Register_Interface_DT_Entry
(Prim : Entity_Id;
Ancestor_Iface_Prim : Entity_Id := Empty)
is
E : Entity_Id;
Prim_Typ : Entity_Id;
Prim_Op : Entity_Id;
Iface_Typ : Entity_Id;
Iface_DT_Ptr : Entity_Id;
Iface_Tag : Entity_Id;
New_Thunk : Node_Id;
Thunk_Id : Entity_Id;
begin
-- Nothing to do if the run-time does not give support to abstract
-- interfaces.
if not (RTE_Available (RE_Interface_Tag)) then
return;
end if;
if No (Ancestor_Iface_Prim) then
Prim_Typ := Scope (DTC_Entity (Alias (Prim)));
-- Look for the abstract interface subprogram
E := Abstract_Interface_Alias (Prim);
while Present (E)
and then Is_Abstract (E)
and then not Is_Interface (Scope (DTC_Entity (E)))
loop
E := Alias (E);
end loop;
Iface_Typ := Scope (DTC_Entity (E));
-- Generate the code of the thunk only when this primitive
-- operation is associated with a secondary dispatch table.
if Is_Interface (Iface_Typ) then
Iface_Tag := Find_Interface_Tag
(T => Prim_Typ,
Iface => Iface_Typ);
if Etype (Iface_Tag) = RTE (RE_Interface_Tag) then
Thunk_Id :=
Make_Defining_Identifier (Loc,
Chars => New_Internal_Name ('T'));
New_Thunk :=
Expand_Interface_Thunk
(N => Prim,
Thunk_Alias => Alias (Prim),
Thunk_Id => Thunk_Id);
Insert_After (N, New_Thunk);
Iface_DT_Ptr :=
Find_Interface_ADT
(T => Prim_Typ,
Iface => Iface_Typ);
Insert_After (New_Thunk,
Fill_Secondary_DT_Entry (Sloc (Prim),
Prim => Prim,
Iface_DT_Ptr => Iface_DT_Ptr,
Thunk_Id => Thunk_Id));
end if;
end if;
else
Iface_Typ :=
Scope (DTC_Entity (Abstract_Interface_Alias
(Ancestor_Iface_Prim)));
Iface_Tag :=
Find_Interface_Tag
(T => Scope (DTC_Entity (Alias (Ancestor_Iface_Prim))),
Iface => Iface_Typ);
-- Generate the thunk only if the associated tag is an interface
-- tag. The case in which the associated tag is the primary tag
-- occurs when a tagged type is a direct derivation of an
-- interface. For example:
-- type I is interface;
-- ...
-- type T is new I with ...
if Etype (Iface_Tag) = RTE (RE_Interface_Tag) then
Thunk_Id :=
Make_Defining_Identifier (Loc,
Chars => New_Internal_Name ('T'));
if Present (Alias (Prim)) then
Prim_Op := Alias (Prim);
else
Prim_Op := Prim;
end if;
New_Thunk :=
Expand_Interface_Thunk
(N => Ancestor_Iface_Prim,
Thunk_Alias => Prim_Op,
Thunk_Id => Thunk_Id);
Insert_After (N, New_Thunk);
Iface_DT_Ptr :=
Find_Interface_ADT
(T => Scope (DTC_Entity (Prim_Op)),
Iface => Iface_Typ);
Insert_After (New_Thunk,
Fill_Secondary_DT_Entry (Sloc (Prim),
Prim => Ancestor_Iface_Prim,
Iface_DT_Ptr => Iface_DT_Ptr,
Thunk_Id => Thunk_Id));
end if;
end if;
end Register_Interface_DT_Entry;
----------------------------------
-- Register_Predefined_DT_Entry --
----------------------------------
procedure Register_Predefined_DT_Entry (Prim : Entity_Id) is
Iface_DT_Ptr : Elmt_Id;
Iface_Tag : Entity_Id;
Iface_Typ : Elmt_Id;
New_Thunk : Entity_Id;
Prim_Typ : Entity_Id;
Thunk_Id : Entity_Id;
begin
Prim_Typ := Scope (DTC_Entity (Prim));
if No (Access_Disp_Table (Prim_Typ))
or else No (Abstract_Interfaces (Prim_Typ))
or else not RTE_Available (RE_Interface_Tag)
then
return;
end if;
-- Skip the first acces-to-dispatch-table pointer since it leads
-- to the primary dispatch table. We are only concerned with the
-- secondary dispatch table pointers. Note that the access-to-
-- dispatch-table pointer corresponds to the first implemented
-- interface retrieved below.
Iface_DT_Ptr := Next_Elmt (First_Elmt (Access_Disp_Table (Prim_Typ)));
Iface_Typ := First_Elmt (Abstract_Interfaces (Prim_Typ));
while Present (Iface_DT_Ptr) and then Present (Iface_Typ) loop
Iface_Tag := Find_Interface_Tag (Prim_Typ, Node (Iface_Typ));
pragma Assert (Present (Iface_Tag));
if Etype (Iface_Tag) = RTE (RE_Interface_Tag) then
Thunk_Id := Make_Defining_Identifier (Loc,
New_Internal_Name ('T'));
New_Thunk :=
Expand_Interface_Thunk
(N => Prim,
Thunk_Alias => Prim,
Thunk_Id => Thunk_Id);
Insert_After (N, New_Thunk);
Insert_After (New_Thunk,
Make_DT_Access_Action (Node (Iface_Typ),
Action => Set_Predefined_Prim_Op_Address,
Args => New_List (
Unchecked_Convert_To (RTE (RE_Tag),
New_Reference_To (Node (Iface_DT_Ptr), Loc)),
Make_Integer_Literal (Loc, DT_Position (Prim)),
Make_Attribute_Reference (Loc,
Prefix => New_Reference_To (Thunk_Id, Loc),
Attribute_Name => Name_Address))));
end if;
Next_Elmt (Iface_DT_Ptr);
Next_Elmt (Iface_Typ);
end loop;
end Register_Predefined_DT_Entry;
-- Start of processing for Freeze_Subprogram
begin
-- When a primitive is frozen, enter its name in the corresponding
-- dispatch table. If the DTC_Entity field is not set this is an
-- overridden primitive that can be ignored. We suppress the
-- initialization of the dispatch table entry when Java_VM because
-- the dispatching mechanism is handled internally by the JVM.
if Is_Dispatching_Operation (E)
and then not Is_Abstract (E)
and then Present (DTC_Entity (E))
and then not Java_VM
and then not Is_CPP_Class (Scope (DTC_Entity (E)))
then
Check_Overriding_Operation (E);
-- Ada 95 case: Register the subprogram in the primary dispatch table
if Ada_Version < Ada_05 then
-- Do not register the subprogram in the dispatch table if we
-- are compiling with the No_Dispatching_Calls restriction.
if not Restriction_Active (No_Dispatching_Calls) then
Insert_After (N,
Fill_DT_Entry (Sloc (N), Prim => E));
end if;
-- Ada 2005 case: Register the subprogram in the secondary dispatch
-- tables associated with abstract interfaces.
else
declare
Typ : constant Entity_Id := Scope (DTC_Entity (E));
begin
-- There is no dispatch table associated with abstract
-- interface types. Each type implementing interfaces will
-- fill the associated secondary DT entries.
if not Is_Interface (Typ)
or else Present (Alias (E))
then
-- Ada 2005 (AI-251): Check if this entry corresponds with
-- a subprogram that covers an abstract interface type.
if Present (Abstract_Interface_Alias (E)) then
Register_Interface_DT_Entry (E);
-- Common case: Primitive subprogram
else
-- Generate thunks for all the predefined operations
if not Restriction_Active (No_Dispatching_Calls) then
if Is_Predefined_Dispatching_Operation (E) then
Register_Predefined_DT_Entry (E);
end if;
Insert_After (N,
Fill_DT_Entry (Sloc (N), Prim => E));
end if;
Check_Overriding_Inherited_Interfaces (E);
end if;
end if;
end;
end if;
end if;
-- Mark functions that return by reference. Note that it cannot be
-- part of the normal semantic analysis of the spec since the
-- underlying returned type may not be known yet (for private types).
declare
Typ : constant Entity_Id := Etype (E);
Utyp : constant Entity_Id := Underlying_Type (Typ);
begin
if Is_Return_By_Reference_Type (Typ) then
Set_Returns_By_Ref (E);
elsif Present (Utyp) and then Controlled_Type (Utyp) then
Set_Returns_By_Ref (E);
end if;
end;
end Freeze_Subprogram;
end Exp_Ch6;
|
with Ada.Containers;
with Ada.Unchecked_Conversion;
with impact.d3.collision.Proxy,
impact.d3.Collision.Algorithm;
package body impact.d3.collision.overlapped_pair_Callback.cached
--
--
--
is
-----------
--- Globals
--
gOverlappingPairs : Integer := 0;
gRemovePairs : Integer := 0;
gAddedPairs : Integer := 0;
gFindPairs : Integer := 0;
--------------------------------
--- btHashedOverlappingPairCache
--
--- Forge
--
function to_btHashedOverlappingPairCache return btHashedOverlappingPairCache
is
Self : btHashedOverlappingPairCache;
begin
Self.m_blockedForChanges := False;
Self.m_overlappingPairArray.reserve_Capacity (2);
Self.growTables;
return Self;
end to_btHashedOverlappingPairCache;
function new_btHashedOverlappingPairCache return btHashedOverlappingPairCache_view
is
Self : constant btHashedOverlappingPairCache_view := new btHashedOverlappingPairCache;
begin
Self.m_blockedForChanges := False;
Self.m_overlappingPairArray.reserve_Capacity (2);
Self.growTables;
return Self;
-- return new btHashedOverlappingPairCache' (to_btHashedOverlappingPairCache);
end new_btHashedOverlappingPairCache;
overriding procedure destruct (Self : in out btHashedOverlappingPairCache)
is
begin
null;
end destruct;
--- Attributes
--
overriding function getOverlappingPairArrayPtr (Self : in btHashedOverlappingPairCache) return btBroadphasePair_Vectors.Cursor
is
begin
return Self.m_overlappingPairArray.First;
end getOverlappingPairArrayPtr;
overriding function getOverlappingPairArray (Self : access btHashedOverlappingPairCache) return access btBroadphasePairArray
is
begin
return Self.m_overlappingPairArray'Access;
end getOverlappingPairArray;
overriding procedure cleanOverlappingPair (Self : in out btHashedOverlappingPairCache; pair : access impact.d3.collision.Proxy.btBroadphasePair;
dispatcher : access impact.d3.Dispatcher.item'Class)
is
pragma Unreferenced (Self);
begin
if pair.m_algorithm /= null then
pair.m_algorithm.destruct;
dispatcher.freeCollisionAlgorithm (pair.m_algorithm);
pair.m_algorithm := null;
end if;
end cleanOverlappingPair;
overriding function getNumOverlappingPairs (Self : in btHashedOverlappingPairCache) return Integer
is
begin
return Integer (Self.m_overlappingPairArray.Length);
end getNumOverlappingPairs;
--- 'cleanProxyFromPairs'
--
type CleanPairCallback is new btOverlapCallback with
record
m_cleanProxy : access impact.d3.collision.Proxy.item'Class;
m_pairCache : access impact.d3.collision.overlapped_pair_Callback.cached.Item'Class;
m_dispatcher : access impact.d3.Dispatcher.item'Class;
end record;
overriding function processOverlap (Self : in CleanPairCallback; pair : access impact.d3.collision.Proxy.btBroadphasePair) return Boolean
is
begin
if pair.m_pProxy0 = Self.m_cleanProxy
or else pair.m_pProxy1 = Self.m_cleanProxy
then
Self.m_pairCache.cleanOverlappingPair (pair, Self.m_dispatcher);
end if;
return False;
end processOverlap;
function to_CleanPairCallback (cleanProxy : access impact.d3.collision.Proxy.item'Class;
pairCache : access impact.d3.collision.overlapped_pair_Callback.cached.Item'Class;
dispatcher : access impact.d3.Dispatcher.item'Class) return CleanPairCallback
is
Self : CleanPairCallback;
begin
Self.m_cleanProxy := cleanProxy;
Self.m_pairCache := pairCache;
Self.m_dispatcher := dispatcher;
return Self;
end to_CleanPairCallback;
overriding procedure cleanProxyFromPairs (Self : access btHashedOverlappingPairCache; proxy : access impact.d3.collision.Proxy.item'Class;
dispatcher : access impact.d3.Dispatcher.item'Class)
is
cleanPairs : aliased CleanPairCallback := to_CleanPairCallback (proxy, Self, dispatcher);
begin
Self.processAllOverlappingPairs (cleanPairs'Access, dispatcher);
end cleanProxyFromPairs;
overriding procedure setOverlapFilterCallback (Self : in out btHashedOverlappingPairCache; callback : access btOverlapFilterCallback'Class)
is
begin
Self.m_overlapFilterCallback := callback;
end setOverlapFilterCallback;
function getOverlapFilterCallback (Self : access btHashedOverlappingPairCache) return access btOverlapFilterCallback'Class
is
begin
return Self.m_overlapFilterCallback;
end getOverlapFilterCallback;
function needsBroadphaseCollision (Self : in btHashedOverlappingPairCache; proxy0, proxy1 : access impact.d3.collision.Proxy.item'Class) return Boolean
is
use type impact.d3.collision.Proxy.CollisionFilterGroups;
collides : Boolean;
begin
if Self.m_overlapFilterCallback /= null then
return Self.m_overlapFilterCallback.needBroadphaseCollision (proxy0, proxy1);
end if;
collides := (proxy0.m_collisionFilterGroup and proxy1.m_collisionFilterMask) /= 0;
collides := collides and then (proxy1.m_collisionFilterGroup and proxy0.m_collisionFilterMask) /= 0;
return collides;
end needsBroadphaseCollision;
function internalAddPair (Self : access btHashedOverlappingPairCache; proxy0, proxy1 : access impact.d3.collision.Proxy.item'Class) return access impact.d3.collision.Proxy.btBroadphasePair
is
use Interfaces;
use type Ada.Containers.Count_type;
the_proxy0 : access impact.d3.collision.Proxy.item'Class := proxy0;
the_proxy1 : access impact.d3.collision.Proxy.item'Class := proxy1;
proxyId1,
proxyId2,
hash : Integer;
pair : access impact.d3.collision.Proxy.btBroadphasePair;
count,
oldCapacity,
newCapacity : Integer;
unused : access impact.d3.collision.Proxy.btBroadphasePair;
pragma Unreferenced (unused);
function to_Integer is new ada.unchecked_Conversion (Unsigned_32, Integer);
begin
if proxy0.m_uniqueId > proxy1.m_uniqueId then
declare
Pad : constant access impact.d3.collision.Proxy.item := the_proxy0;
begin
the_proxy0 := the_proxy1;
the_proxy1 := Pad; -- btSwap (proxy0, proxy1);
end;
end if;
proxyId1 := the_proxy0.getUid;
proxyId2 := the_proxy1.getUid;
declare
kkk : Unsigned_32 := getHash (proxyId1, proxyId2);
ppp : Integer := Integer (Self.m_overlappingPairArray.capacity - 1);
jjj : Unsigned_32 := Unsigned_32 (Self.m_overlappingPairArray.capacity - 1);
begin
null;
end;
hash := to_Integer (getHash (proxyId1, proxyId2) and Unsigned_32 (Self.m_overlappingPairArray.capacity - 1)); -- New hash value with new mask.
pair := Self.internalFindPair (the_proxy0, the_proxy1, hash);
if pair /= null then
return pair;
end if;
count := Integer (Self.m_overlappingPairArray.Length);
oldCapacity := Integer (Self.m_overlappingPairArray.capacity);
-- void* mem = &m_overlappingPairArray.expandNonInitializing();
-- pair = new (mem) btBroadphasePair(*proxy0,*proxy1);
pair := new impact.d3.collision.Proxy.btBroadphasePair'(impact.d3.collision.Proxy.to_btBroadphasePair (the_proxy0, the_proxy1));
pair.m_algorithm := null;
pair.internals.m_internalTmpValue := 0;
Self.m_overlappingPairArray.append (pair);
-- this is where we add an actual pair, so also call the 'ghost'
--
if Self.m_ghostPairCallback /= null then
unused := Self.m_ghostPairCallback.addOverlappingPair (the_proxy0, the_proxy1);
end if;
newCapacity := Integer (Self.m_overlappingPairArray.capacity);
if oldCapacity < newCapacity then
Self.growTables;
hash := Integer (getHash (proxyId1, proxyId2) and Unsigned_32 (Self.m_overlappingPairArray.capacity - 1)); -- hash with new capacity
end if;
Self.m_next .replace_Element (count + 1, Unsigned_32'(Self.m_hashTable.Element (hash + 1)));
Self.m_hashTable.replace_Element (hash + 1, Unsigned_32 (count + 1));
return pair;
end internalAddPair;
procedure growTables (Self : in out btHashedOverlappingPairCache)
is
use type ada.containers.Count_type;
newCapacity : constant ada.containers.Count_type := Self.m_overlappingPairArray.capacity;
curHashtableSize : Integer;
begin
if Self.m_hashTable.Length < newCapacity then -- grow 'hashtable' and 'next' table
curHashtableSize := Integer (Self.m_hashTable.Length);
Self.m_hashTable.set_Length (newCapacity);
Self.m_next .set_Length (newCapacity);
for i in 1 .. Integer (newCapacity)
loop
Self.m_hashTable.replace_Element (i, BT_NULL_PAIR);
end loop;
for i in 1 .. Integer (newCapacity)
loop
Self.m_next.replace_Element (i, BT_NULL_PAIR);
end loop;
for i in 1 .. Integer (curHashtableSize)
loop
declare
use Interfaces;
pair : constant access impact.d3.collision.Proxy.btBroadphasePair := Self.m_overlappingPairArray.Element (i);
proxyId1 : constant Integer := pair.m_pProxy0.getUid;
proxyId2 : constant Integer := pair.m_pProxy1.getUid;
hashValue : constant Unsigned_32 := (getHash (proxyId1, proxyId2) and Unsigned_32 (Self.m_overlappingPairArray.capacity - 1)) + 1; -- New hash value with new mask
begin
Self.m_next .replace_Element (i, Unsigned_32'(Self.m_hashTable.Element (Integer (hashValue))));
Self.m_hashTable.replace_Element (Integer (hashValue), Unsigned_32 (i));
end;
end loop;
end if;
end growTables;
function equalsPair (Self : in btHashedOverlappingPairCache; pair : in impact.d3.collision.Proxy.btBroadphasePair;
proxyId1, proxyId2 : in Integer) return Boolean
is
pragma Unreferenced (Self);
begin
return pair.m_pProxy0.getUid = proxyId1
and then pair.m_pProxy1.getUid = proxyId2;
end equalsPair;
overriding procedure processAllOverlappingPairs (Self : in out btHashedOverlappingPairCache; callback : access btOverlapCallback'Class;
dispatcher : access impact.d3.Dispatcher.item'Class)
is
pair : access impact.d3.collision.Proxy.btBroadphasePair;
i : Integer := 1;
unused : access Any'Class;
pragma Unreferenced (unused);
begin
while i <= Integer (Self.m_overlappingPairArray.Length)
loop
pair := Self.m_overlappingPairArray.Element (i);
if callback.processOverlap (pair) then
unused := Self.removeOverlappingPair (pair.m_pProxy0, pair.m_pProxy1, dispatcher);
gOverlappingPairs := gOverlappingPairs - 1;
else
i := i + 1;
end if;
end loop;
end processAllOverlappingPairs;
overriding function findPair (Self : in btHashedOverlappingPairCache; proxy0, proxy1 : access impact.d3.collision.Proxy.item) return access impact.d3.collision.Proxy.btBroadphasePair
is
use Interfaces;
the_proxy0 : access impact.d3.collision.Proxy.item := proxy0;
the_proxy1 : access impact.d3.collision.Proxy.item := proxy1;
index,
hash : Integer;
proxyId1,
proxyId2 : Integer;
begin
gFindPairs := gFindPairs + 1;
if the_proxy0.m_uniqueId > the_proxy1.m_uniqueId then
declare
Pad : constant access impact.d3.collision.Proxy.item := the_proxy0;
begin
the_proxy0 := the_proxy1;
the_proxy1 := Pad; -- btSwap (proxy0, proxy1);
end;
end if;
proxyId1 := the_proxy0.getUid;
proxyId2 := the_proxy1.getUid;
hash := Integer (getHash (proxyId1, proxyId2) and (Unsigned_32 (Self.m_overlappingPairArray.capacity) - 1));
if hash >= Integer (Self.m_hashTable.Length) then
return null;
end if;
index := Integer (Unsigned_32'(Self.m_hashTable.Element (hash)));
while Unsigned_32 (index) /= BT_NULL_PAIR
and then not Self.equalsPair (Self.m_overlappingPairArray.Element (index).all, proxyId1, proxyId2)
loop
index := Integer (Unsigned_32'(Self.m_next.Element (index)));
end loop;
if Unsigned_32 (index) = BT_NULL_PAIR then
return null;
end if;
pragma Assert (index <= Integer (Self.m_overlappingPairArray.Length));
return Self.m_overlappingPairArray.Element (index);
end findPair;
overriding function hasDeferredRemoval (Self : in btHashedOverlappingPairCache) return Boolean
is
pragma Unreferenced (Self);
begin
return False;
end hasDeferredRemoval;
overriding procedure setInternalGhostPairCallback (Self : in out btHashedOverlappingPairCache; ghostPairCallback : access impact.d3.collision.overlapped_pair_Callback.item'Class)
is
begin
Self.m_ghostPairCallback := ghostPairCallback;
end setInternalGhostPairCallback;
overriding procedure sortOverlappingPairs (Self : in out btHashedOverlappingPairCache; dispatcher : access impact.d3.Dispatcher.item'Class)
is
-- need to keep hashmap in sync with pair address, so rebuild all
tmpPairs : btBroadphasePairArray;
function "<" (L, R : in impact.d3.collision.Proxy.btBroadphasePair_view) return Boolean
is
begin
return impact.d3.collision.Proxy.btBroadphasePairSortPredicate (L.all, R.all);
end;
package Sorter is new btBroadphasePair_Vectors.generic_Sorting ("<");
unused : access Any'Class;
pragma Unreferenced (unused);
unused_pair : access impact.d3.collision.Proxy.btBroadphasePair;
pragma Unreferenced (unused_pair);
begin
for i in 1 .. Integer (Self.m_overlappingPairArray.Length)
loop
tmpPairs.append (Self.m_overlappingPairArray.Element (i));
end loop;
for i in 1 .. Integer (tmpPairs.Length)
loop
unused := Self.removeOverlappingPair (tmpPairs.Element (i).m_pProxy0, tmpPairs.Element (i).m_pProxy1, dispatcher);
end loop;
for i in 1 .. Integer (Self.m_next.Length)
loop
Self.m_next.replace_Element (i, BT_NULL_PAIR);
end loop;
Sorter.sort (tmpPairs); -- tmpPairs.quickSort (btBroadphasePairSortPredicate());
for i in 1 .. Integer (tmpPairs.Length)
loop
unused_pair := Self.addOverlappingPair (tmpPairs.Element (i).m_pProxy0,
tmpPairs.Element (i).m_pProxy1);
end loop;
end sortOverlappingPairs;
-- Add a pair and return the new pair. If the pair already exists,
-- no new pair is created and the old one is returned.
--
overriding function addOverlappingPair (Self : access btHashedOverlappingPairCache; proxy0, proxy1 : access impact.d3.collision.Proxy.item'Class) return access impact.d3.collision.Proxy.btBroadphasePair
is
begin
gAddedPairs := gAddedPairs + 1;
if not Self.needsBroadphaseCollision (proxy0, proxy1) then
return null;
end if;
return Self.internalAddPair (proxy0, proxy1);
end addOverlappingPair;
overriding function removeOverlappingPair (Self : access btHashedOverlappingPairCache; proxy0, proxy1 : access impact.d3.collision.Proxy.item'Class;
dispatcher : access impact.d3.Dispatcher.item'Class) return access Any'Class
is
use Interfaces;
use type Ada.Containers.count_type;
the_proxy0 : access impact.d3.collision.Proxy.item := proxy0;
the_proxy1 : access impact.d3.collision.Proxy.item := proxy1;
proxyId1,
proxyId2 : Integer;
hash : Integer;
pair : access impact.d3.collision.Proxy.btBroadphasePair;
userData : access Any'Class;
pairIndex,
lastPairIndex : Integer;
index,
previous : Unsigned_32;
last : access impact.d3.collision.Proxy.btBroadphasePair;
lastHash : Integer;
unused : access Any'Class;
pragma Unreferenced (unused);
begin
gRemovePairs := gRemovePairs + 1;
if the_proxy0.m_uniqueId > the_proxy1.m_uniqueId then
declare
Pad : constant access impact.d3.collision.Proxy.item := the_proxy0;
begin
the_proxy0 := the_proxy1;
the_proxy1 := Pad; -- btSwap (proxy0, proxy1);
end;
end if;
proxyId1 := the_proxy0.getUid;
proxyId2 := the_proxy1.getUid;
hash := Integer (getHash (proxyId1, proxyId2) and Unsigned_32 (Self.m_overlappingPairArray.capacity - 1));
pair := Self.internalFindPair (the_proxy0, the_proxy1, hash);
if pair = null then
return null;
end if;
Self.cleanOverlappingPair (pair, dispatcher);
userData := pair.internals.m_internalInfo1;
pragma Assert (pair.m_pProxy0.getUid = proxyId1);
pragma Assert (pair.m_pProxy1.getUid = proxyId2);
pairIndex := Self.internalFindPairIndex (the_proxy0, the_proxy1, hash); -- Integer (pair - Self.m_overlappingPairArray (1));
pragma Assert (pairIndex <= Integer (Self.m_overlappingPairArray.Length));
-- Remove the pair from the hash table.
index := Self.m_hashTable.Element (hash + 1);
pragma Assert (Unsigned_32 (index) /= BT_NULL_PAIR);
previous := BT_NULL_PAIR;
while index /= Unsigned_32 (pairIndex)
loop
previous := index;
index := Self.m_next.Element (Integer (index));
end loop;
if previous /= BT_NULL_PAIR then
pragma Assert (Self.m_next.Element (Integer (previous)) = Unsigned_32 (pairIndex));
Self.m_next.replace_Element (Integer (previous), Unsigned_32'(Self.m_next.Element (pairIndex)));
else
Self.m_hashTable.replace_Element (hash + 1, Unsigned_32'(Self.m_next.Element (pairIndex)));
end if;
-- We now move the last pair into spot of the
-- pair being removed. We need to fix the hash
-- table indices to support the move.
lastPairIndex := Integer (Self.m_overlappingPairArray.Length - 0);
if Self.m_ghostPairCallback /= null then
unused := Self.m_ghostPairCallback.removeOverlappingPair (the_proxy0, the_proxy1, dispatcher);
end if;
-- If the removed pair is the last pair, we are done.
--
if lastPairIndex = pairIndex then
Self.m_overlappingPairArray.delete_Last;
return userData;
end if;
-- Remove the last pair from the hash table.
last := Self.m_overlappingPairArray.Element (lastPairIndex);
-- missing swap here too, Nat.
lastHash := Integer (getHash (last.m_pProxy0.getUid, last.m_pProxy1.getUid) and Unsigned_32 (Self.m_overlappingPairArray.capacity - 1));
index := Self.m_hashTable.Element (lastHash + 1);
pragma Assert (index /= BT_NULL_PAIR);
previous := BT_NULL_PAIR;
while index /= Unsigned_32 (lastPairIndex)
loop
previous := index;
index := Self.m_next.Element (Integer (index));
end loop;
if previous /= BT_NULL_PAIR then
pragma Assert (Unsigned_32'(Self.m_next.Element (Integer (previous))) = Unsigned_32 (lastPairIndex));
Self.m_next.replace_Element (Integer (previous), Unsigned_32'(Self.m_next.Element (lastPairIndex)));
else
Self.m_hashTable.replace_Element (lastHash + 1, Unsigned_32'(Self.m_next.Element (lastPairIndex)));
end if;
-- Copy the last pair into the remove pair's spot.
Self.m_overlappingPairArray.replace_Element (pairIndex, impact.d3.collision.Proxy.btBroadphasePair_view'(Self.m_overlappingPairArray.Element (lastPairIndex)));
-- Insert the last pair into the hash table
Self.m_next.replace_Element (pairIndex, Unsigned_32'(Self.m_hashTable.Element (lastHash + 1)));
Self.m_hashTable.replace_Element (lastHash + 1, Unsigned_32 (pairIndex));
Self.m_overlappingPairArray.delete_Last;
return userData;
end removeOverlappingPair;
--- 'removeOverlappingPairsContainingProxy'
--
type RemovePairCallback is new btOverlapCallback with
record
m_obsoleteProxy : access impact.d3.collision.Proxy.item'Class;
end record;
overriding function processOverlap (Self : in RemovePairCallback; pair : access impact.d3.collision.Proxy.btBroadphasePair) return Boolean
is
begin
return pair.m_pProxy0 = Self.m_obsoleteProxy
or else pair.m_pProxy1 = Self.m_obsoleteProxy;
end processOverlap;
function to_RemovePairCallback (obsoleteProxy : access impact.d3.collision.Proxy.item'Class) return RemovePairCallback
is
Self : RemovePairCallback;
begin
Self.m_obsoleteProxy := obsoleteProxy;
return Self;
end to_RemovePairCallback;
overriding procedure removeOverlappingPairsContainingProxy (Self : access btHashedOverlappingPairCache; proxy0 : access impact.d3.collision.Proxy.item'Class;
dispatcher : access impact.d3.Dispatcher.item'Class)
is
removeCallback : aliased RemovePairCallback := to_RemovePairCallback (proxy0);
begin
Self.processAllOverlappingPairs (removeCallback'Access, dispatcher);
end removeOverlappingPairsContainingProxy;
function GetCount (Self : in btHashedOverlappingPairCache) return Integer
is
begin
return Integer (Self.m_overlappingPairArray.Length);
end GetCount;
function internalFindPairIndex (Self : access btHashedOverlappingPairCache; proxy0, proxy1 : access impact.d3.collision.Proxy.item'Class;
hash : in Integer) return Integer
is
use Interfaces;
proxyId1 : constant Integer := proxy0.getUid;
proxyId2 : constant Integer := proxy1.getUid;
index : Unsigned_32 := Self.m_hashTable.Element (hash + 1);
begin
while Interfaces.unsigned_32 (index) /= BT_NULL_PAIR
and then not Self.equalsPair (Self.m_overlappingPairArray.Element (Integer (index)).all, proxyId1, proxyId2)
loop
index := Self.m_next.Element (Integer (index));
end loop;
if Interfaces.unsigned_32 (index) = BT_NULL_PAIR then
return 0;
end if;
pragma Assert (index <= Unsigned_32 (Self.m_overlappingPairArray.Length));
return Integer (index);
end internalFindPairIndex;
function internalFindPair (Self : access btHashedOverlappingPairCache; proxy0, proxy1 : access impact.d3.collision.Proxy.item'Class;
hash : in Integer) return access collision.Proxy.btBroadphasePair
is
index : constant Integer := Self.internalFindPairIndex (proxy0, proxy1, hash);
begin
if index = 0 then
return null;
end if;
return Self.m_overlappingPairArray.Element (index);
end internalFindPair;
function getHash (proxyId1, proxyId2 : in Integer) return Interfaces.Unsigned_32
is
use Interfaces;
key : Unsigned_32 := Unsigned_32 (proxyId1)
or shift_Left (Unsigned_32 (proxyId2), 16);
begin
-- Thomas Wang's hash
--
key := key + not shift_Left (key, 15);
key := key xor shift_Right (key, 10);
key := key + shift_Left (key, 3);
key := key xor shift_Right (key, 6);
key := key + not shift_Left (key, 11);
key := key xor shift_Right (key, 16);
return key;
end getHash;
--------------------------------
--- btSortedOverlappingPairCache
--
--- Forge
--
function to_btSortedOverlappingPairCache return btSortedOverlappingPairCache
is
Self : btSortedOverlappingPairCache;
begin
Self.m_blockedForChanges := False;
Self.m_hasDeferredRemoval := True;
Self.m_overlappingPairArray.reserve_Capacity (2);
return Self;
end to_btSortedOverlappingPairCache;
overriding procedure destruct (Self : in out btSortedOverlappingPairCache)
is
begin
null;
end destruct;
--- Attributes
--
overriding function getOverlappingPairArrayPtr (Self : in btSortedOverlappingPairCache) return btBroadphasePair_Vectors.Cursor
is
begin
return Self.m_overlappingPairArray.First;
end getOverlappingPairArrayPtr;
overriding function getOverlappingPairArray (Self : access btSortedOverlappingPairCache) return access btBroadphasePairArray
is
begin
return Self.m_overlappingPairArray'Access;
end getOverlappingPairArray;
overriding procedure cleanOverlappingPair (Self : in out btSortedOverlappingPairCache; pair : access impact.d3.collision.Proxy.btBroadphasePair;
dispatcher : access impact.d3.Dispatcher.item'Class)
is
pragma Unreferenced (Self);
begin
if pair.m_algorithm /= null then
pair.m_algorithm.destruct;
dispatcher.freeCollisionAlgorithm (pair.m_algorithm);
pair.m_algorithm := null;
gRemovePairs := gRemovePairs - 1;
end if;
end cleanOverlappingPair;
overriding function getNumOverlappingPairs (Self : in btSortedOverlappingPairCache) return Integer
is
begin
return Integer (Self.m_overlappingPairArray.Length);
end getNumOverlappingPairs;
overriding procedure cleanProxyFromPairs (Self : access btSortedOverlappingPairCache; proxy : access impact.d3.collision.Proxy.item'Class;
dispatcher : access impact.d3.Dispatcher.item'Class)
is
type CleanPairCallback is new btOverlapCallback with
record
m_cleanProxy : access impact.d3.collision.Proxy.item;
m_pairCache : access impact.d3.collision.overlapped_pair_Callback.cached.Item'Class;
m_dispatcher : access impact.d3.Dispatcher.item;
end record;
overriding function processOverlap (Self : in CleanPairCallback; pair : access impact.d3.collision.Proxy.btBroadphasePair) return Boolean;
function to_CleanPairCallback (cleanProxy : access impact.d3.collision.Proxy.item'Class;
pairCache : access impact.d3.collision.overlapped_pair_Callback.cached.item'Class;
dispatcher : access impact.d3.Dispatcher.item'Class) return CleanPairCallback
is
Self : CleanPairCallback;
begin
Self.m_cleanProxy := cleanProxy;
Self.m_pairCache := pairCache;
Self.m_dispatcher := dispatcher;
return Self;
end to_CleanPairCallback;
overriding function processOverlap (Self : in CleanPairCallback; pair : access impact.d3.collision.Proxy.btBroadphasePair) return Boolean
is
begin
if pair.m_pProxy0 = Self.m_cleanProxy
or else pair.m_pProxy1 = Self.m_cleanProxy
then
Self.m_pairCache.cleanOverlappingPair (pair, Self.m_dispatcher);
end if;
return False;
end processOverlap;
cleanPairs : aliased CleanPairCallback := to_CleanPairCallback (proxy, Self, dispatcher);
begin
Self.processAllOverlappingPairs (cleanPairs'Access, dispatcher);
end cleanProxyFromPairs;
overriding procedure processAllOverlappingPairs (Self : in out btSortedOverlappingPairCache; callback : access btOverlapCallback'Class;
dispatcher : access impact.d3.Dispatcher.item'Class)
is
i : Integer := 1;
pair : impact.d3.collision.Proxy.btBroadphasePair_view;
begin
while i <= Integer (Self.m_overlappingPairArray.Length)
loop
pair := Self.m_overlappingPairArray.Element (i);
if callback.processOverlap (pair) then
Self.cleanOverlappingPair (pair, dispatcher);
pair.m_pProxy0 := null;
pair.m_pProxy1 := null;
Self.m_overlappingPairArray.swap (i, Integer (Self.m_overlappingPairArray.Length) - 0);
Self.m_overlappingPairArray.delete_Last;
gOverlappingPairs := gOverlappingPairs - 1;
else
i := i + 1;
end if;
end loop;
end processAllOverlappingPairs;
-- This findPair becomes really slow. Either sort the list to speedup the query, or
-- use a different solution. It is mainly used for Removing overlapping pairs. Removal could be delayed.
-- we could keep a linked list in each proxy, and store pair in one of the proxies (with lowest memory address)
-- Also we can use a 2D bitmap, which can be useful for a future GPU implementation
--
overriding function findPair (Self : in btSortedOverlappingPairCache; proxy0, proxy1 : access impact.d3.collision.Proxy.item) return access impact.d3.collision.Proxy.btBroadphasePair
is
begin
if not Self.needsBroadphaseCollision (proxy0, proxy1) then
return null;
end if;
declare
use btBroadphasePair_Vectors, impact.d3.collision.Proxy;
tmpPair : constant btBroadphasePair := to_btBroadphasePair (proxy0, proxy1);
Cursor : btBroadphasePair_Vectors.Cursor := Self.m_overlappingPairArray.First;
begin
while has_Element (Cursor)
loop
if Element (Cursor).all = tmpPair then
return Element (Cursor);
end if;
next (Cursor);
end loop;
end;
return null;
end findPair;
overriding function hasDeferredRemoval (Self : in btSortedOverlappingPairCache) return Boolean
is
begin
return Self.m_hasDeferredRemoval;
end hasDeferredRemoval;
overriding procedure setInternalGhostPairCallback (Self : in out btSortedOverlappingPairCache; ghostPairCallback : access impact.d3.collision.overlapped_pair_Callback.item'Class)
is
begin
Self.m_ghostPairCallback := ghostPairCallback;
end setInternalGhostPairCallback;
overriding procedure sortOverlappingPairs (Self : in out btSortedOverlappingPairCache; dispatcher : access impact.d3.Dispatcher.item'Class)
is
begin
null; -- Should already be sorted.
end sortOverlappingPairs;
function needsBroadphaseCollision (Self : in btSortedOverlappingPairCache; proxy0, proxy1 : access impact.d3.collision.Proxy.item'Class) return Boolean
is
use type impact.d3.collision.Proxy.CollisionFilterGroups;
collides : Boolean;
begin
if Self.m_overlapFilterCallback /= null then
return Self.m_overlapFilterCallback.needBroadphaseCollision (proxy0, proxy1);
end if;
collides := (proxy0.m_collisionFilterGroup and proxy1.m_collisionFilterMask) /= 0;
collides := collides and then (proxy1.m_collisionFilterGroup and proxy0.m_collisionFilterMask) /= 0;
return collides;
end needsBroadphaseCollision;
overriding function addOverlappingPair (Self : access btSortedOverlappingPairCache; proxy0, proxy1 : access impact.d3.collision.Proxy.item'Class) return access impact.d3.collision.Proxy.btBroadphasePair
is
begin
pragma Assert (proxy0 /= proxy1); -- don't add overlap with own
if not Self.needsBroadphaseCollision (proxy0, proxy1) then
return null;
end if;
declare
use impact.d3.collision.Proxy;
pair : constant btBroadphasePair_view := new btBroadphasePair'(to_btBroadphasePair (proxy0, proxy1));
unused : access btBroadphasePair;
pragma Unreferenced (unused);
begin
gOverlappingPairs := gOverlappingPairs + 1;
gAddedPairs := gAddedPairs + 1;
if Self.m_ghostPairCallback /= null then
unused := Self.m_ghostPairCallback.addOverlappingPair (proxy0, proxy1);
end if;
Self.m_overlappingPairArray.Append (pair);
return pair;
end;
end addOverlappingPair;
type Any_View is access all Any'Class;
overriding
function removeOverlappingPair (Self : access btSortedOverlappingPairCache; proxy0, proxy1 : access impact.d3.collision.Proxy.item'Class;
dispatcher : access impact.d3.Dispatcher.item'Class) return access Any'Class
is
use impact.d3.collision.Proxy;
findPair : btBroadphasePair_view;
findIndex : Integer;
userData : Any_view;
begin
if not Self.hasDeferredRemoval then
findPair := new btBroadphasePair'(to_btBroadphasePair (proxy0, proxy1));
findIndex := Self.m_overlappingPairArray.find_Index (findPair);
if findIndex <= Integer (Self.m_overlappingPairArray.Length) then
gOverlappingPairs := gOverlappingPairs - 1;
declare
pair : constant btBroadphasePair_view := Self.m_overlappingPairArray.Element (findIndex);
unused : access Any'Class;
pragma Unreferenced (unused);
begin
userData := pair.internals.m_internalInfo1.all'Access;
Self.cleanOverlappingPair (pair, dispatcher);
if Self.m_ghostPairCallback /= null then
unused := Self.m_ghostPairCallback.removeOverlappingPair (proxy0, proxy1, dispatcher);
end if;
Self.m_overlappingPairArray.replace_Element (findIndex, pair);
end;
end if;
Self.m_overlappingPairArray.swap (findIndex, Integer (Self.m_overlappingPairArray.capacity) - 0);
Self.m_overlappingPairArray.delete_Last;
return Any_view (userData);
end if;
return null;
end removeOverlappingPair;
overriding procedure removeOverlappingPairsContainingProxy (Self : access btSortedOverlappingPairCache; proxy : access impact.d3.collision.Proxy.item'Class;
dispatcher : access impact.d3.Dispatcher.item'Class)
is
type RemovePairCallback is new btOverlapCallback with
record
m_obsoleteProxy : access impact.d3.collision.Proxy.item;
end record;
overriding function processOverlap (Self : in RemovePairCallback; pair : access impact.d3.collision.Proxy.btBroadphasePair) return Boolean;
function to_RemovePairCallback (obsoleteProxy : access impact.d3.collision.Proxy.item'Class) return RemovePairCallback
is
Self : RemovePairCallback;
begin
Self.m_obsoleteProxy := obsoleteProxy;
return Self;
end to_RemovePairCallback;
overriding function processOverlap (Self : in RemovePairCallback; pair : access impact.d3.collision.Proxy.btBroadphasePair) return Boolean
is
begin
return pair.m_pProxy0 = Self.m_obsoleteProxy
or else pair.m_pProxy1 = Self.m_obsoleteProxy;
end processOverlap;
removeCallback : aliased RemovePairCallback := to_RemovePairCallback (proxy);
begin
Self.processAllOverlappingPairs (removeCallback'Access, dispatcher);
end removeOverlappingPairsContainingProxy;
function getOverlapFilterCallback (Self : access btSortedOverlappingPairCache) return access btOverlapFilterCallback'Class
is
begin
return Self.m_overlapFilterCallback;
end getOverlapFilterCallback;
overriding procedure setOverlapFilterCallback (Self : in out btSortedOverlappingPairCache; callback : access btOverlapFilterCallback'Class)
is
begin
Self.m_overlapFilterCallback := callback;
end setOverlapFilterCallback;
end impact.d3.collision.overlapped_pair_Callback.cached;
|
package CLIC.Config.Info is
function List (This : CLIC.Config.Instance;
Filter : String := ".*";
Show_Origin : Boolean := False)
return AAA.Strings.Vector;
-- Return a Vector of String that contains a list of configuration
-- key/value as seen in the configuration. When Show_Origin is true,
-- the configuration file where each key was loaded is also listed.
--
-- The keys not matching the Filter regular expression (see GNAT.Regpat)
-- are ignored.
function List_Keys (This : CLIC.Config.Instance;
Filter : String := ".*")
return AAA.Strings.Vector;
-- Same as above but only return the config keys
end CLIC.Config.Info;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . P A C K _ 0 3 --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- Handling of packed arrays with Component_Size = 3
package System.Pack_03 is
pragma Preelaborate;
Bits : constant := 3;
type Bits_03 is mod 2 ** Bits;
for Bits_03'Size use Bits;
-- In all subprograms below, Rev_SSO is set True if the array has the
-- non-default scalar storage order.
function Get_03
(Arr : System.Address;
N : Natural;
Rev_SSO : Boolean) return Bits_03 with Inline;
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is extracted and returned.
procedure Set_03
(Arr : System.Address;
N : Natural;
E : Bits_03;
Rev_SSO : Boolean) with Inline;
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is set to the given value.
end System.Pack_03;
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2016-2018, 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 NRF51_SVD.GPIO; use NRF51_SVD.GPIO;
package body nRF51.GPIO is
overriding
function Mode (This : GPIO_Point) return HAL.GPIO.GPIO_Mode is
CNF : PIN_CNF_Register renames GPIO_Periph.PIN_CNF (This.Pin);
begin
case CNF.DIR is
when Input => return HAL.GPIO.Input;
when Output => return HAL.GPIO.Output;
end case;
end Mode;
--------------
-- Set_Mode --
--------------
overriding
procedure Set_Mode (This : in out GPIO_Point;
Mode : HAL.GPIO.GPIO_Config_Mode)
is
CNF : PIN_CNF_Register renames GPIO_Periph.PIN_CNF (This.Pin);
begin
CNF.DIR := (case Mode is
when HAL.GPIO.Input => Input,
when HAL.GPIO.Output => Output);
CNF.INPUT := (case Mode is
when HAL.GPIO.Input => Connect,
when HAL.GPIO.Output => Disconnect);
end Set_Mode;
---------
-- Set --
---------
overriding
function Set
(This : GPIO_Point)
return Boolean
is
begin
return GPIO_Periph.IN_k.Arr (This.Pin) = High;
end Set;
-------------------
-- Pull_Resistor --
-------------------
overriding
function Pull_Resistor (This : GPIO_Point)
return HAL.GPIO.GPIO_Pull_Resistor
is
begin
case GPIO_Periph.PIN_CNF (This.Pin).PULL is
when Disabled => return HAL.GPIO.Floating;
when Pulldown => return HAL.GPIO.Pull_Down;
when Pullup => return HAL.GPIO.Pull_Up;
end case;
end Pull_Resistor;
-----------------------
-- Set_Pull_Resistor --
-----------------------
overriding
procedure Set_Pull_Resistor (This : in out GPIO_Point;
Pull : HAL.GPIO.GPIO_Pull_Resistor)
is
begin
GPIO_Periph.PIN_CNF (This.Pin).PULL :=
(case Pull is
when HAL.GPIO.Floating => Disabled,
when HAL.GPIO.Pull_Down => Pulldown,
when HAL.GPIO.Pull_Up => Pullup);
end Set_Pull_Resistor;
---------
-- Set --
---------
overriding procedure Set
(This : in out GPIO_Point)
is
begin
GPIO_Periph.OUT_k.Arr (This.Pin) := High;
end Set;
-----------
-- Clear --
-----------
overriding procedure Clear
(This : in out GPIO_Point)
is
begin
GPIO_Periph.OUT_k.Arr (This.Pin) := Low;
end Clear;
------------
-- Toggle --
------------
overriding procedure Toggle
(This : in out GPIO_Point)
is
begin
if This.Set then
This.Clear;
else
This.Set;
end if;
end Toggle;
------------------
-- Configure_IO --
------------------
procedure Configure_IO
(This : GPIO_Point;
Config : GPIO_Configuration)
is
CNF : PIN_CNF_Register renames GPIO_Periph.PIN_CNF (This.Pin);
begin
CNF.DIR := (case Config.Mode is
when Mode_In => Input,
when Mode_Out => Output);
CNF.INPUT := (case Config.Input_Buffer is
when Input_Buffer_Connect => Connect,
when Input_Buffer_Disconnect => Disconnect);
CNF.PULL := (case Config.Resistors is
when No_Pull => Disabled,
when Pull_Up => Pullup,
when Pull_Down => Pulldown);
CNF.DRIVE := (case Config.Drive is
when Drive_S0S1 => S0S1,
when Drive_H0S1 => H0S1,
when Drive_S0H1 => S0H1,
when Drive_H0H1 => H0H1,
when Drive_D0S1 => D0S1,
when Drive_D0H1 => D0H1,
when Drive_S0D1 => S0D1,
when Drive_H0D1 => H0D1);
CNF.SENSE := (case Config.Sense is
when Sense_Disabled => Disabled,
when Sense_For_High_Level => High,
when Sense_For_Low_Level => Low);
end Configure_IO;
end nRF51.GPIO;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . S T O R A G E _ P O O L S . S U B P O O L S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2011-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.Finalization;
with System.Finalization_Masters;
with System.Storage_Elements;
package System.Storage_Pools.Subpools is
pragma Preelaborate;
type Root_Storage_Pool_With_Subpools is abstract
new Root_Storage_Pool with private;
pragma Preelaborable_Initialization (Root_Storage_Pool_With_Subpools);
-- The base for all implementations of Storage_Pool_With_Subpools. This
-- type is Limited_Controlled by derivation. To use subpools, an access
-- type must be associated with an implementation descending from type
-- Root_Storage_Pool_With_Subpools.
type Root_Subpool is abstract tagged limited private;
pragma Preelaborable_Initialization (Root_Subpool);
-- The base for all implementations of Subpool. Objects of this type are
-- managed by the pool_with_subpools.
type Subpool_Handle is access all Root_Subpool'Class;
for Subpool_Handle'Storage_Size use 0;
-- Since subpools are limited types by definition, a handle is instead used
-- to manage subpool abstractions.
overriding procedure Allocate
(Pool : in out Root_Storage_Pool_With_Subpools;
Storage_Address : out System.Address;
Size_In_Storage_Elements : System.Storage_Elements.Storage_Count;
Alignment : System.Storage_Elements.Storage_Count);
-- Allocate an object described by Size_In_Storage_Elements and Alignment
-- on the default subpool of Pool. Controlled types allocated through this
-- routine will NOT be handled properly.
procedure Allocate_From_Subpool
(Pool : in out Root_Storage_Pool_With_Subpools;
Storage_Address : out System.Address;
Size_In_Storage_Elements : System.Storage_Elements.Storage_Count;
Alignment : System.Storage_Elements.Storage_Count;
Subpool : not null Subpool_Handle) is abstract;
-- ??? This precondition causes errors in simple tests, disabled for now
-- with Pre'Class => Pool_Of_Subpool (Subpool) = Pool'Access;
-- This routine requires implementation. Allocate an object described by
-- Size_In_Storage_Elements and Alignment on a subpool.
function Create_Subpool
(Pool : in out Root_Storage_Pool_With_Subpools)
return not null Subpool_Handle is abstract;
-- This routine requires implementation. Create a subpool within the given
-- pool_with_subpools.
overriding procedure Deallocate
(Pool : in out Root_Storage_Pool_With_Subpools;
Storage_Address : System.Address;
Size_In_Storage_Elements : System.Storage_Elements.Storage_Count;
Alignment : System.Storage_Elements.Storage_Count)
is null;
procedure Deallocate_Subpool
(Pool : in out Root_Storage_Pool_With_Subpools;
Subpool : in out Subpool_Handle)
is abstract;
-- This precondition causes errors in simple tests, disabled for now???
-- with Pre'Class => Pool_Of_Subpool (Subpool) = Pool'Access;
-- This routine requires implementation. Reclaim the storage a particular
-- subpool occupies in a pool_with_subpools. This routine is called by
-- Ada.Unchecked_Deallocate_Subpool.
function Default_Subpool_For_Pool
(Pool : in out Root_Storage_Pool_With_Subpools)
return not null Subpool_Handle;
-- Return a common subpool which is used for object allocations without a
-- Subpool_Handle_Name in the allocator. The default implementation of this
-- routine raises Program_Error.
function Pool_Of_Subpool
(Subpool : not null Subpool_Handle)
return access Root_Storage_Pool_With_Subpools'Class;
-- Return the owner of the subpool
procedure Set_Pool_Of_Subpool
(Subpool : not null Subpool_Handle;
To : in out Root_Storage_Pool_With_Subpools'Class);
-- Set the owner of the subpool. This is intended to be called from
-- Create_Subpool or similar subpool constructors. Raises Program_Error
-- if the subpool already belongs to a pool.
overriding function Storage_Size
(Pool : Root_Storage_Pool_With_Subpools)
return System.Storage_Elements.Storage_Count
is
(System.Storage_Elements.Storage_Count'Last);
private
-- Model
-- Pool_With_Subpools SP_Node SP_Node SP_Node
-- +-->+--------------------+ +-----+ +-----+ +-----+
-- | | Subpools -------->| ------->| ------->| ------->
-- | +--------------------+ +-----+ +-----+ +-----+
-- | |Finalization_Started|<------ |<------- |<------- |<---
-- | +--------------------+ +-----+ +-----+ +-----+
-- +--- Controller.Encl_Pool| | nul | | + | | + |
-- | +--------------------+ +-----+ +--|--+ +--:--+
-- | : : Dummy | ^ :
-- | : : | | :
-- | Root_Subpool V |
-- | +-------------+ |
-- +-------------------------------- Owner | |
-- FM_Node FM_Node +-------------+ |
-- +-----+ +-----+<-- Master.Objects| |
-- <------ |<------ | +-------------+ |
-- +-----+ +-----+ | Node -------+
-- | ------>| -----> +-------------+
-- +-----+ +-----+ : :
-- |ctrl | Dummy : :
-- | obj |
-- +-----+
--
-- SP_Nodes are created on the heap. FM_Nodes and associated objects are
-- created on the pool_with_subpools.
type Any_Storage_Pool_With_Subpools_Ptr
is access all Root_Storage_Pool_With_Subpools'Class;
for Any_Storage_Pool_With_Subpools_Ptr'Storage_Size use 0;
-- A pool controller is a special controlled object which ensures the
-- proper initialization and finalization of the enclosing pool.
type Pool_Controller (Enclosing_Pool : Any_Storage_Pool_With_Subpools_Ptr)
is new Ada.Finalization.Limited_Controlled with null record;
-- Subpool list types. Each pool_with_subpools contains a list of subpools.
-- This is an indirect doubly linked list since subpools are not supposed
-- to be allocatable by language design.
type SP_Node;
type SP_Node_Ptr is access all SP_Node;
type SP_Node is record
Prev : SP_Node_Ptr := null;
Next : SP_Node_Ptr := null;
Subpool : Subpool_Handle := null;
end record;
-- Root_Storage_Pool_With_Subpools internal structure. The type uses a
-- special controller to perform initialization and finalization actions
-- on itself. This is necessary because the end user of this package may
-- decide to override Initialize and Finalize, thus disabling the desired
-- behavior.
-- Pool_With_Subpools SP_Node SP_Node SP_Node
-- +-->+--------------------+ +-----+ +-----+ +-----+
-- | | Subpools -------->| ------->| ------->| ------->
-- | +--------------------+ +-----+ +-----+ +-----+
-- | |Finalization_Started| : : : : : :
-- | +--------------------+
-- +--- Controller.Encl_Pool|
-- +--------------------+
-- : End-user :
-- : components :
type Root_Storage_Pool_With_Subpools is abstract
new Root_Storage_Pool with
record
Subpools : aliased SP_Node;
-- A doubly linked list of subpools
Finalization_Started : Boolean := False;
pragma Atomic (Finalization_Started);
-- A flag which prevents the creation of new subpools while the master
-- pool is being finalized. The flag needs to be atomic because it is
-- accessed without Lock_Task / Unlock_Task.
Controller : Pool_Controller
(Root_Storage_Pool_With_Subpools'Unchecked_Access);
-- A component which ensures that the enclosing pool is initialized and
-- finalized at the appropriate places.
end record;
-- A subpool is an abstraction layer which sits on top of a pool. It
-- contains links to all controlled objects allocated on a particular
-- subpool.
-- Pool_With_Subpools SP_Node SP_Node SP_Node
-- +-->+----------------+ +-----+ +-----+ +-----+
-- | | Subpools ------>| ------->| ------->| ------->
-- | +----------------+ +-----+ +-----+ +-----+
-- | : :<------ |<------- |<------- |
-- | : : +-----+ +-----+ +-----+
-- | |null | | + | | + |
-- | +-----+ +--|--+ +--:--+
-- | | ^ :
-- | Root_Subpool V |
-- | +-------------+ |
-- +---------------------------- Owner | |
-- +-------------+ |
-- .......... Master | |
-- +-------------+ |
-- | Node -------+
-- +-------------+
-- : End-user :
-- : components :
type Root_Subpool is abstract tagged limited record
Owner : Any_Storage_Pool_With_Subpools_Ptr := null;
-- A reference to the master pool_with_subpools
Master : aliased System.Finalization_Masters.Finalization_Master;
-- A heterogeneous collection of controlled objects
Node : SP_Node_Ptr := null;
-- A link to the doubly linked list node which contains the subpool.
-- This back pointer is used in subpool deallocation.
end record;
procedure Adjust_Controlled_Dereference
(Addr : in out System.Address;
Storage_Size : in out System.Storage_Elements.Storage_Count;
Alignment : System.Storage_Elements.Storage_Count);
-- Given the memory attributes of a heap-allocated object that is known to
-- be controlled, adjust the address and size of the object to include the
-- two hidden pointers inserted by the finalization machinery.
-- ??? Once Storage_Pools.Allocate_Any is removed, this should be renamed
-- to Allocate_Any.
procedure Allocate_Any_Controlled
(Pool : in out Root_Storage_Pool'Class;
Context_Subpool : Subpool_Handle;
Context_Master : Finalization_Masters.Finalization_Master_Ptr;
Fin_Address : Finalization_Masters.Finalize_Address_Ptr;
Addr : out System.Address;
Storage_Size : System.Storage_Elements.Storage_Count;
Alignment : System.Storage_Elements.Storage_Count;
Is_Controlled : Boolean;
On_Subpool : Boolean);
-- Compiler interface. This version of Allocate handles all possible cases,
-- either on a pool or a pool_with_subpools, regardless of the controlled
-- status of the allocated object. Parameter usage:
--
-- * Pool - The pool associated with the access type. Pool can be any
-- derivation from Root_Storage_Pool, including a pool_with_subpools.
--
-- * Context_Subpool - The subpool handle name of an allocator. If no
-- subpool handle is present at the point of allocation, the actual
-- would be null.
--
-- * Context_Master - The finalization master associated with the access
-- type. If the access type's designated type is not controlled, the
-- actual would be null.
--
-- * Fin_Address - TSS routine Finalize_Address of the designated type.
-- If the designated type is not controlled, the actual would be null.
--
-- * Addr - The address of the allocated object.
--
-- * Storage_Size - The size of the allocated object.
--
-- * Alignment - The alignment of the allocated object.
--
-- * Is_Controlled - A flag which determines whether the allocated object
-- is controlled. When set to True, the machinery generates additional
-- data.
--
-- * On_Subpool - A flag which determines whether the a subpool handle
-- name is present at the point of allocation. This is used for error
-- diagnostics.
procedure Deallocate_Any_Controlled
(Pool : in out Root_Storage_Pool'Class;
Addr : System.Address;
Storage_Size : System.Storage_Elements.Storage_Count;
Alignment : System.Storage_Elements.Storage_Count;
Is_Controlled : Boolean);
-- Compiler interface. This version of Deallocate handles all possible
-- cases, either from a pool or a pool_with_subpools, regardless of the
-- controlled status of the deallocated object. Parameter usage:
--
-- * Pool - The pool associated with the access type. Pool can be any
-- derivation from Root_Storage_Pool, including a pool_with_subpools.
--
-- * Addr - The address of the allocated object.
--
-- * Storage_Size - The size of the allocated object.
--
-- * Alignment - The alignment of the allocated object.
--
-- * Is_Controlled - A flag which determines whether the allocated object
-- is controlled. When set to True, the machinery generates additional
-- data.
procedure Detach (N : not null SP_Node_Ptr);
-- Unhook a subpool node from an arbitrary subpool list
overriding procedure Finalize (Controller : in out Pool_Controller);
-- Buffer routine, calls Finalize_Pool
procedure Finalize_Pool (Pool : in out Root_Storage_Pool_With_Subpools);
-- Iterate over all subpools of Pool, detach them one by one and finalize
-- their masters. This action first detaches a controlled object from a
-- particular master, then invokes its Finalize_Address primitive.
function Header_Size_With_Padding
(Alignment : System.Storage_Elements.Storage_Count)
return System.Storage_Elements.Storage_Count;
-- Given an arbitrary alignment, calculate the size of the header which
-- precedes a controlled object as the nearest multiple rounded up of the
-- alignment.
overriding procedure Initialize (Controller : in out Pool_Controller);
-- Buffer routine, calls Initialize_Pool
procedure Initialize_Pool (Pool : in out Root_Storage_Pool_With_Subpools);
-- Setup the doubly linked list of subpools
procedure Print_Pool (Pool : Root_Storage_Pool_With_Subpools);
-- Debug routine, output the contents of a pool_with_subpools
procedure Print_Subpool (Subpool : Subpool_Handle);
-- Debug routine, output the contents of a subpool
end System.Storage_Pools.Subpools;
|
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
with ABR; use ABR;
-- Afficher la fréquence absolue des caractères d'une chaîne de caractère.
procedure Frequences_Caracteres is
-- Calculer la fréquence absolue (Frequences) de chaque caractère de Texte.
procedure Calculer_Frequences_Absolues (Texte : in String ; Frequences : out T_ABR) is
begin
Null; -- TODO : à changer
end Calculer_Frequences_Absolues;
Frequences: T_ABR;
begin
Calculer_Frequences_Absolues ("DCEFABCCAABAA", Frequences);
-- afficher les résultats
Put_Line ("Nombre de caractères différents : "
& Integer'Image (Taille (Frequences)));
Afficher (Frequences);
Afficher_Debug (Frequences);
-- vérifier les résulats
pragma Assert (Taille (Frequences) = 6);
pragma Assert (La_Donnee (Frequences, 'A') = 5);
pragma Assert (La_Donnee (Frequences, 'B') = 2);
pragma Assert (La_Donnee (Frequences, 'C') = 3);
for C in Character range 'D'..'F' loop
pragma Assert (La_Donnee (Frequences, C) = 1);
end loop;
end Frequences_Caracteres;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- E X P _ A T T R --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Aspects; use Aspects;
with Atree; use Atree;
with Checks; use Checks;
with Einfo; use Einfo;
with Elists; use Elists;
with Exp_Atag; use Exp_Atag;
with Exp_Ch2; use Exp_Ch2;
with Exp_Ch3; use Exp_Ch3;
with Exp_Ch6; use Exp_Ch6;
with Exp_Ch9; use Exp_Ch9;
with Exp_Dist; use Exp_Dist;
with Exp_Imgv; use Exp_Imgv;
with Exp_Pakd; use Exp_Pakd;
with Exp_Strm; use Exp_Strm;
with Exp_Tss; use Exp_Tss;
with Exp_Util; use Exp_Util;
with Fname; use Fname;
with Freeze; use Freeze;
with Gnatvsn; use Gnatvsn;
with Itypes; use Itypes;
with Lib; use Lib;
with Namet; use Namet;
with Nmake; use Nmake;
with Nlists; use Nlists;
with Opt; use Opt;
with Restrict; use Restrict;
with Rident; use Rident;
with Rtsfind; use Rtsfind;
with Sem; use Sem;
with Sem_Aux; use Sem_Aux;
with Sem_Ch6; use Sem_Ch6;
with Sem_Ch7; use Sem_Ch7;
with Sem_Ch8; use Sem_Ch8;
with Sem_Eval; use Sem_Eval;
with Sem_Res; use Sem_Res;
with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Snames; use Snames;
with Stand; use Stand;
with Stringt; use Stringt;
with Targparm; use Targparm;
with Tbuild; use Tbuild;
with Ttypes; use Ttypes;
with Uintp; use Uintp;
with Uname; use Uname;
with Validsw; use Validsw;
package body Exp_Attr is
-----------------------
-- Local Subprograms --
-----------------------
function Build_Array_VS_Func
(A_Type : Entity_Id;
Nod : Node_Id) return Entity_Id;
-- Build function to test Valid_Scalars for array type A_Type. Nod is the
-- Valid_Scalars attribute node, used to insert the function body, and the
-- value returned is the entity of the constructed function body. We do not
-- bother to generate a separate spec for this subprogram.
function Build_Record_VS_Func
(R_Type : Entity_Id;
Nod : Node_Id) return Entity_Id;
-- Build function to test Valid_Scalars for record type A_Type. Nod is the
-- Valid_Scalars attribute node, used to insert the function body, and the
-- value returned is the entity of the constructed function body. We do not
-- bother to generate a separate spec for this subprogram.
procedure Compile_Stream_Body_In_Scope
(N : Node_Id;
Decl : Node_Id;
Arr : Entity_Id;
Check : Boolean);
-- The body for a stream subprogram may be generated outside of the scope
-- of the type. If the type is fully private, it may depend on the full
-- view of other types (e.g. indexes) that are currently private as well.
-- We install the declarations of the package in which the type is declared
-- before compiling the body in what is its proper environment. The Check
-- parameter indicates if checks are to be suppressed for the stream body.
-- We suppress checks for array/record reads, since the rule is that these
-- are like assignments, out of range values due to uninitialized storage,
-- or other invalid values do NOT cause a Constraint_Error to be raised.
-- If we are within an instance body all visibility has been established
-- already and there is no need to install the package.
-- This mechanism is now extended to the component types of the array type,
-- when the component type is not in scope and is private, to handle
-- properly the case when the full view has defaulted discriminants.
-- This special processing is ultimately caused by the fact that the
-- compiler lacks a well-defined phase when full views are visible
-- everywhere. Having such a separate pass would remove much of the
-- special-case code that shuffles partial and full views in the middle
-- of semantic analysis and expansion.
procedure Expand_Access_To_Protected_Op
(N : Node_Id;
Pref : Node_Id;
Typ : Entity_Id);
-- An attribute reference to a protected subprogram is transformed into
-- a pair of pointers: one to the object, and one to the operations.
-- This expansion is performed for 'Access and for 'Unrestricted_Access.
procedure Expand_Fpt_Attribute
(N : Node_Id;
Pkg : RE_Id;
Nam : Name_Id;
Args : List_Id);
-- This procedure expands a call to a floating-point attribute function.
-- N is the attribute reference node, and Args is a list of arguments to
-- be passed to the function call. Pkg identifies the package containing
-- the appropriate instantiation of System.Fat_Gen. Float arguments in Args
-- have already been converted to the floating-point type for which Pkg was
-- instantiated. The Nam argument is the relevant attribute processing
-- routine to be called. This is the same as the attribute name, except in
-- the Unaligned_Valid case.
procedure Expand_Fpt_Attribute_R (N : Node_Id);
-- This procedure expands a call to a floating-point attribute function
-- that takes a single floating-point argument. The function to be called
-- is always the same as the attribute name.
procedure Expand_Fpt_Attribute_RI (N : Node_Id);
-- This procedure expands a call to a floating-point attribute function
-- that takes one floating-point argument and one integer argument. The
-- function to be called is always the same as the attribute name.
procedure Expand_Fpt_Attribute_RR (N : Node_Id);
-- This procedure expands a call to a floating-point attribute function
-- that takes two floating-point arguments. The function to be called
-- is always the same as the attribute name.
procedure Expand_Loop_Entry_Attribute (N : Node_Id);
-- Handle the expansion of attribute 'Loop_Entry. As a result, the related
-- loop may be converted into a conditional block. See body for details.
procedure Expand_Min_Max_Attribute (N : Node_Id);
-- Handle the expansion of attributes 'Max and 'Min, including expanding
-- then out if we are in Modify_Tree_For_C mode.
procedure Expand_Pred_Succ_Attribute (N : Node_Id);
-- Handles expansion of Pred or Succ attributes for case of non-real
-- operand with overflow checking required.
procedure Expand_Update_Attribute (N : Node_Id);
-- Handle the expansion of attribute Update
function Get_Index_Subtype (N : Node_Id) return Entity_Id;
-- Used for Last, Last, and Length, when the prefix is an array type.
-- Obtains the corresponding index subtype.
procedure Find_Fat_Info
(T : Entity_Id;
Fat_Type : out Entity_Id;
Fat_Pkg : out RE_Id);
-- Given a floating-point type T, identifies the package containing the
-- attributes for this type (returned in Fat_Pkg), and the corresponding
-- type for which this package was instantiated from Fat_Gen. Error if T
-- is not a floating-point type.
function Find_Stream_Subprogram
(Typ : Entity_Id;
Nam : TSS_Name_Type) return Entity_Id;
-- Returns the stream-oriented subprogram attribute for Typ. For tagged
-- types, the corresponding primitive operation is looked up, else the
-- appropriate TSS from the type itself, or from its closest ancestor
-- defining it, is returned. In both cases, inheritance of representation
-- aspects is thus taken into account.
function Full_Base (T : Entity_Id) return Entity_Id;
-- The stream functions need to examine the underlying representation of
-- composite types. In some cases T may be non-private but its base type
-- is, in which case the function returns the corresponding full view.
function Get_Stream_Convert_Pragma (T : Entity_Id) return Node_Id;
-- Given a type, find a corresponding stream convert pragma that applies to
-- the implementation base type of this type (Typ). If found, return the
-- pragma node, otherwise return Empty if no pragma is found.
function Is_Constrained_Packed_Array (Typ : Entity_Id) return Boolean;
-- Utility for array attributes, returns true on packed constrained
-- arrays, and on access to same.
function Is_Inline_Floating_Point_Attribute (N : Node_Id) return Boolean;
-- Returns true iff the given node refers to an attribute call that
-- can be expanded directly by the back end and does not need front end
-- expansion. Typically used for rounding and truncation attributes that
-- appear directly inside a conversion to integer.
-------------------------
-- Build_Array_VS_Func --
-------------------------
function Build_Array_VS_Func
(A_Type : Entity_Id;
Nod : Node_Id) return Entity_Id
is
Loc : constant Source_Ptr := Sloc (Nod);
Func_Id : constant Entity_Id := Make_Temporary (Loc, 'V');
Comp_Type : constant Entity_Id := Component_Type (A_Type);
Body_Stmts : List_Id;
Index_List : List_Id;
Formals : List_Id;
function Test_Component return List_Id;
-- Create one statement to test validity of one component designated by
-- a full set of indexes. Returns statement list containing test.
function Test_One_Dimension (N : Int) return List_Id;
-- Create loop to test one dimension of the array. The single statement
-- in the loop body tests the inner dimensions if any, or else the
-- single component. Note that this procedure is called recursively,
-- with N being the dimension to be initialized. A call with N greater
-- than the number of dimensions simply generates the component test,
-- terminating the recursion. Returns statement list containing tests.
--------------------
-- Test_Component --
--------------------
function Test_Component return List_Id is
Comp : Node_Id;
Anam : Name_Id;
begin
Comp :=
Make_Indexed_Component (Loc,
Prefix => Make_Identifier (Loc, Name_uA),
Expressions => Index_List);
if Is_Scalar_Type (Comp_Type) then
Anam := Name_Valid;
else
Anam := Name_Valid_Scalars;
end if;
return New_List (
Make_If_Statement (Loc,
Condition =>
Make_Op_Not (Loc,
Right_Opnd =>
Make_Attribute_Reference (Loc,
Attribute_Name => Anam,
Prefix => Comp)),
Then_Statements => New_List (
Make_Simple_Return_Statement (Loc,
Expression => New_Occurrence_Of (Standard_False, Loc)))));
end Test_Component;
------------------------
-- Test_One_Dimension --
------------------------
function Test_One_Dimension (N : Int) return List_Id is
Index : Entity_Id;
begin
-- If all dimensions dealt with, we simply test the component
if N > Number_Dimensions (A_Type) then
return Test_Component;
-- Here we generate the required loop
else
Index :=
Make_Defining_Identifier (Loc, New_External_Name ('J', N));
Append (New_Occurrence_Of (Index, Loc), Index_List);
return New_List (
Make_Implicit_Loop_Statement (Nod,
Identifier => Empty,
Iteration_Scheme =>
Make_Iteration_Scheme (Loc,
Loop_Parameter_Specification =>
Make_Loop_Parameter_Specification (Loc,
Defining_Identifier => Index,
Discrete_Subtype_Definition =>
Make_Attribute_Reference (Loc,
Prefix => Make_Identifier (Loc, Name_uA),
Attribute_Name => Name_Range,
Expressions => New_List (
Make_Integer_Literal (Loc, N))))),
Statements => Test_One_Dimension (N + 1)),
Make_Simple_Return_Statement (Loc,
Expression => New_Occurrence_Of (Standard_True, Loc)));
end if;
end Test_One_Dimension;
-- Start of processing for Build_Array_VS_Func
begin
Index_List := New_List;
Body_Stmts := Test_One_Dimension (1);
-- Parameter is always (A : A_Typ)
Formals := New_List (
Make_Parameter_Specification (Loc,
Defining_Identifier => Make_Defining_Identifier (Loc, Name_uA),
In_Present => True,
Out_Present => False,
Parameter_Type => New_Occurrence_Of (A_Type, Loc)));
-- Build body
Set_Ekind (Func_Id, E_Function);
Set_Is_Internal (Func_Id);
Insert_Action (Nod,
Make_Subprogram_Body (Loc,
Specification =>
Make_Function_Specification (Loc,
Defining_Unit_Name => Func_Id,
Parameter_Specifications => Formals,
Result_Definition =>
New_Occurrence_Of (Standard_Boolean, Loc)),
Declarations => New_List,
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,
Statements => Body_Stmts)));
if not Debug_Generated_Code then
Set_Debug_Info_Off (Func_Id);
end if;
Set_Is_Pure (Func_Id);
return Func_Id;
end Build_Array_VS_Func;
--------------------------
-- Build_Record_VS_Func --
--------------------------
-- Generates:
-- function _Valid_Scalars (X : T) return Boolean is
-- begin
-- -- Check discriminants
-- if not X.D1'Valid_Scalars or else
-- not X.D2'Valid_Scalars or else
-- ...
-- then
-- return False;
-- end if;
-- -- Check components
-- if not X.C1'Valid_Scalars or else
-- not X.C2'Valid_Scalars or else
-- ...
-- then
-- return False;
-- end if;
-- -- Check variant part
-- case X.D1 is
-- when V1 =>
-- if not X.C2'Valid_Scalars or else
-- not X.C3'Valid_Scalars or else
-- ...
-- then
-- return False;
-- end if;
-- ...
-- when Vn =>
-- if not X.Cn'Valid_Scalars or else
-- ...
-- then
-- return False;
-- end if;
-- end case;
-- return True;
-- end _Valid_Scalars;
function Build_Record_VS_Func
(R_Type : Entity_Id;
Nod : Node_Id) return Entity_Id
is
Loc : constant Source_Ptr := Sloc (R_Type);
Func_Id : constant Entity_Id := Make_Temporary (Loc, 'V');
X : constant Entity_Id := Make_Defining_Identifier (Loc, Name_X);
function Make_VS_Case
(E : Entity_Id;
CL : Node_Id;
Discrs : Elist_Id := New_Elmt_List) return List_Id;
-- Building block for variant valid scalars. Given a Component_List node
-- CL, it generates an 'if' followed by a 'case' statement that compares
-- all components of local temporaries named X and Y (that are declared
-- as formals at some upper level). E provides the Sloc to be used for
-- the generated code.
function Make_VS_If
(E : Entity_Id;
L : List_Id) return Node_Id;
-- Building block for variant validate scalars. Given the list, L, of
-- components (or discriminants) L, it generates a return statement that
-- compares all components of local temporaries named X and Y (that are
-- declared as formals at some upper level). E provides the Sloc to be
-- used for the generated code.
------------------
-- Make_VS_Case --
------------------
-- <Make_VS_If on shared components>
-- case X.D1 is
-- when V1 => <Make_VS_Case> on subcomponents
-- ...
-- when Vn => <Make_VS_Case> on subcomponents
-- end case;
function Make_VS_Case
(E : Entity_Id;
CL : Node_Id;
Discrs : Elist_Id := New_Elmt_List) return List_Id
is
Loc : constant Source_Ptr := Sloc (E);
Result : constant List_Id := New_List;
Variant : Node_Id;
Alt_List : List_Id;
begin
Append_To (Result, Make_VS_If (E, Component_Items (CL)));
if No (Variant_Part (CL)) then
return Result;
end if;
Variant := First_Non_Pragma (Variants (Variant_Part (CL)));
if No (Variant) then
return Result;
end if;
Alt_List := New_List;
while Present (Variant) loop
Append_To (Alt_List,
Make_Case_Statement_Alternative (Loc,
Discrete_Choices => New_Copy_List (Discrete_Choices (Variant)),
Statements =>
Make_VS_Case (E, Component_List (Variant), Discrs)));
Next_Non_Pragma (Variant);
end loop;
Append_To (Result,
Make_Case_Statement (Loc,
Expression =>
Make_Selected_Component (Loc,
Prefix => Make_Identifier (Loc, Name_X),
Selector_Name => New_Copy (Name (Variant_Part (CL)))),
Alternatives => Alt_List));
return Result;
end Make_VS_Case;
----------------
-- Make_VS_If --
----------------
-- Generates:
-- if
-- not X.C1'Valid_Scalars
-- or else
-- not X.C2'Valid_Scalars
-- ...
-- then
-- return False;
-- end if;
-- or a null statement if the list L is empty
function Make_VS_If
(E : Entity_Id;
L : List_Id) return Node_Id
is
Loc : constant Source_Ptr := Sloc (E);
C : Node_Id;
Def_Id : Entity_Id;
Field_Name : Name_Id;
Cond : Node_Id;
begin
if No (L) then
return Make_Null_Statement (Loc);
else
Cond := Empty;
C := First_Non_Pragma (L);
while Present (C) loop
Def_Id := Defining_Identifier (C);
Field_Name := Chars (Def_Id);
-- The tags need not be checked since they will always be valid
-- Note also that in the following, we use Make_Identifier for
-- the component names. Use of New_Occurrence_Of to identify
-- the components would be incorrect because wrong entities for
-- discriminants could be picked up in the private type case.
-- Don't bother with abstract parent in interface case
if Field_Name = Name_uParent
and then Is_Interface (Etype (Def_Id))
then
null;
-- Don't bother with tag, always valid, and not scalar anyway
elsif Field_Name = Name_uTag then
null;
-- Don't bother with component with no scalar components
elsif not Scalar_Part_Present (Etype (Def_Id)) then
null;
-- Normal case, generate Valid_Scalars attribute reference
else
Evolve_Or_Else (Cond,
Make_Op_Not (Loc,
Right_Opnd =>
Make_Attribute_Reference (Loc,
Prefix =>
Make_Selected_Component (Loc,
Prefix =>
Make_Identifier (Loc, Name_X),
Selector_Name =>
Make_Identifier (Loc, Field_Name)),
Attribute_Name => Name_Valid_Scalars)));
end if;
Next_Non_Pragma (C);
end loop;
if No (Cond) then
return Make_Null_Statement (Loc);
else
return
Make_Implicit_If_Statement (E,
Condition => Cond,
Then_Statements => New_List (
Make_Simple_Return_Statement (Loc,
Expression =>
New_Occurrence_Of (Standard_False, Loc))));
end if;
end if;
end Make_VS_If;
-- Local variables
Def : constant Node_Id := Parent (R_Type);
Comps : constant Node_Id := Component_List (Type_Definition (Def));
Stmts : constant List_Id := New_List;
Pspecs : constant List_Id := New_List;
-- Start of processing for Build_Record_VS_Func
begin
Append_To (Pspecs,
Make_Parameter_Specification (Loc,
Defining_Identifier => X,
Parameter_Type => New_Occurrence_Of (R_Type, Loc)));
Append_To (Stmts,
Make_VS_If (R_Type, Discriminant_Specifications (Def)));
Append_List_To (Stmts, Make_VS_Case (R_Type, Comps));
Append_To (Stmts,
Make_Simple_Return_Statement (Loc,
Expression => New_Occurrence_Of (Standard_True, Loc)));
Insert_Action (Nod,
Make_Subprogram_Body (Loc,
Specification =>
Make_Function_Specification (Loc,
Defining_Unit_Name => Func_Id,
Parameter_Specifications => Pspecs,
Result_Definition => New_Occurrence_Of (Standard_Boolean, Loc)),
Declarations => New_List,
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc, Statements => Stmts)),
Suppress => Discriminant_Check);
if not Debug_Generated_Code then
Set_Debug_Info_Off (Func_Id);
end if;
Set_Is_Pure (Func_Id);
return Func_Id;
end Build_Record_VS_Func;
----------------------------------
-- Compile_Stream_Body_In_Scope --
----------------------------------
procedure Compile_Stream_Body_In_Scope
(N : Node_Id;
Decl : Node_Id;
Arr : Entity_Id;
Check : Boolean)
is
C_Type : constant Entity_Id := Base_Type (Component_Type (Arr));
Curr : constant Entity_Id := Current_Scope;
Install : Boolean := False;
Scop : Entity_Id := Scope (Arr);
begin
if Is_Hidden (Arr)
and then not In_Open_Scopes (Scop)
and then Ekind (Scop) = E_Package
then
Install := True;
else
-- The component type may be private, in which case we install its
-- full view to compile the subprogram.
-- The component type may be private, in which case we install its
-- full view to compile the subprogram. We do not do this if the
-- type has a Stream_Convert pragma, which indicates that there are
-- special stream-processing operations for that type (for example
-- Unbounded_String and its wide varieties).
Scop := Scope (C_Type);
if Is_Private_Type (C_Type)
and then Present (Full_View (C_Type))
and then not In_Open_Scopes (Scop)
and then Ekind (Scop) = E_Package
and then No (Get_Stream_Convert_Pragma (C_Type))
then
Install := True;
end if;
end if;
-- If we are within an instance body, then all visibility has been
-- established already and there is no need to install the package.
if Install and then not In_Instance_Body then
Push_Scope (Scop);
Install_Visible_Declarations (Scop);
Install_Private_Declarations (Scop);
-- The entities in the package are now visible, but the generated
-- stream entity must appear in the current scope (usually an
-- enclosing stream function) so that itypes all have their proper
-- scopes.
Push_Scope (Curr);
else
Install := False;
end if;
if Check then
Insert_Action (N, Decl);
else
Insert_Action (N, Decl, Suppress => All_Checks);
end if;
if Install then
-- Remove extra copy of current scope, and package itself
Pop_Scope;
End_Package_Scope (Scop);
end if;
end Compile_Stream_Body_In_Scope;
-----------------------------------
-- Expand_Access_To_Protected_Op --
-----------------------------------
procedure Expand_Access_To_Protected_Op
(N : Node_Id;
Pref : Node_Id;
Typ : Entity_Id)
is
-- The value of the attribute_reference is a record containing two
-- fields: an access to the protected object, and an access to the
-- subprogram itself. The prefix is a selected component.
Loc : constant Source_Ptr := Sloc (N);
Agg : Node_Id;
Btyp : constant Entity_Id := Base_Type (Typ);
Sub : Entity_Id;
Sub_Ref : Node_Id;
E_T : constant Entity_Id := Equivalent_Type (Btyp);
Acc : constant Entity_Id :=
Etype (Next_Component (First_Component (E_T)));
Obj_Ref : Node_Id;
Curr : Entity_Id;
-- Start of processing for Expand_Access_To_Protected_Op
begin
-- Within the body of the protected type, the prefix designates a local
-- operation, and the object is the first parameter of the corresponding
-- protected body of the current enclosing operation.
if Is_Entity_Name (Pref) then
-- All indirect calls are external calls, so must do locking and
-- barrier reevaluation, even if the 'Access occurs within the
-- protected body. Hence the call to External_Subprogram, as opposed
-- to Protected_Body_Subprogram, below. See RM-9.5(5). This means
-- that indirect calls from within the same protected body will
-- deadlock, as allowed by RM-9.5.1(8,15,17).
Sub := New_Occurrence_Of (External_Subprogram (Entity (Pref)), Loc);
-- Don't traverse the scopes when the attribute occurs within an init
-- proc, because we directly use the _init formal of the init proc in
-- that case.
Curr := Current_Scope;
if not Is_Init_Proc (Curr) then
pragma Assert (In_Open_Scopes (Scope (Entity (Pref))));
while Scope (Curr) /= Scope (Entity (Pref)) loop
Curr := Scope (Curr);
end loop;
end if;
-- In case of protected entries the first formal of its Protected_
-- Body_Subprogram is the address of the object.
if Ekind (Curr) = E_Entry then
Obj_Ref :=
New_Occurrence_Of
(First_Formal
(Protected_Body_Subprogram (Curr)), Loc);
-- If the current scope is an init proc, then use the address of the
-- _init formal as the object reference.
elsif Is_Init_Proc (Curr) then
Obj_Ref :=
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (First_Formal (Curr), Loc),
Attribute_Name => Name_Address);
-- In case of protected subprograms the first formal of its
-- Protected_Body_Subprogram is the object and we get its address.
else
Obj_Ref :=
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of
(First_Formal
(Protected_Body_Subprogram (Curr)), Loc),
Attribute_Name => Name_Address);
end if;
-- Case where the prefix is not an entity name. Find the
-- version of the protected operation to be called from
-- outside the protected object.
else
Sub :=
New_Occurrence_Of
(External_Subprogram
(Entity (Selector_Name (Pref))), Loc);
Obj_Ref :=
Make_Attribute_Reference (Loc,
Prefix => Relocate_Node (Prefix (Pref)),
Attribute_Name => Name_Address);
end if;
Sub_Ref :=
Make_Attribute_Reference (Loc,
Prefix => Sub,
Attribute_Name => Name_Access);
-- We set the type of the access reference to the already generated
-- access_to_subprogram type, and declare the reference analyzed, to
-- prevent further expansion when the enclosing aggregate is analyzed.
Set_Etype (Sub_Ref, Acc);
Set_Analyzed (Sub_Ref);
Agg :=
Make_Aggregate (Loc,
Expressions => New_List (Obj_Ref, Sub_Ref));
-- Sub_Ref has been marked as analyzed, but we still need to make sure
-- Sub is correctly frozen.
Freeze_Before (N, Entity (Sub));
Rewrite (N, Agg);
Analyze_And_Resolve (N, E_T);
-- For subsequent analysis, the node must retain its type. The backend
-- will replace it with the equivalent type where needed.
Set_Etype (N, Typ);
end Expand_Access_To_Protected_Op;
--------------------------
-- Expand_Fpt_Attribute --
--------------------------
procedure Expand_Fpt_Attribute
(N : Node_Id;
Pkg : RE_Id;
Nam : Name_Id;
Args : List_Id)
is
Loc : constant Source_Ptr := Sloc (N);
Typ : constant Entity_Id := Etype (N);
Fnm : Node_Id;
begin
-- The function name is the selected component Attr_xxx.yyy where
-- Attr_xxx is the package name, and yyy is the argument Nam.
-- Note: it would be more usual to have separate RE entries for each
-- of the entities in the Fat packages, but first they have identical
-- names (so we would have to have lots of renaming declarations to
-- meet the normal RE rule of separate names for all runtime entities),
-- and second there would be an awful lot of them.
Fnm :=
Make_Selected_Component (Loc,
Prefix => New_Occurrence_Of (RTE (Pkg), Loc),
Selector_Name => Make_Identifier (Loc, Nam));
-- The generated call is given the provided set of parameters, and then
-- wrapped in a conversion which converts the result to the target type
-- We use the base type as the target because a range check may be
-- required.
Rewrite (N,
Unchecked_Convert_To (Base_Type (Etype (N)),
Make_Function_Call (Loc,
Name => Fnm,
Parameter_Associations => Args)));
Analyze_And_Resolve (N, Typ);
end Expand_Fpt_Attribute;
----------------------------
-- Expand_Fpt_Attribute_R --
----------------------------
-- The single argument is converted to its root type to call the
-- appropriate runtime function, with the actual call being built
-- by Expand_Fpt_Attribute
procedure Expand_Fpt_Attribute_R (N : Node_Id) is
E1 : constant Node_Id := First (Expressions (N));
Ftp : Entity_Id;
Pkg : RE_Id;
begin
Find_Fat_Info (Etype (E1), Ftp, Pkg);
Expand_Fpt_Attribute
(N, Pkg, Attribute_Name (N),
New_List (Unchecked_Convert_To (Ftp, Relocate_Node (E1))));
end Expand_Fpt_Attribute_R;
-----------------------------
-- Expand_Fpt_Attribute_RI --
-----------------------------
-- The first argument is converted to its root type and the second
-- argument is converted to standard long long integer to call the
-- appropriate runtime function, with the actual call being built
-- by Expand_Fpt_Attribute
procedure Expand_Fpt_Attribute_RI (N : Node_Id) is
E1 : constant Node_Id := First (Expressions (N));
Ftp : Entity_Id;
Pkg : RE_Id;
E2 : constant Node_Id := Next (E1);
begin
Find_Fat_Info (Etype (E1), Ftp, Pkg);
Expand_Fpt_Attribute
(N, Pkg, Attribute_Name (N),
New_List (
Unchecked_Convert_To (Ftp, Relocate_Node (E1)),
Unchecked_Convert_To (Standard_Integer, Relocate_Node (E2))));
end Expand_Fpt_Attribute_RI;
-----------------------------
-- Expand_Fpt_Attribute_RR --
-----------------------------
-- The two arguments are converted to their root types to call the
-- appropriate runtime function, with the actual call being built
-- by Expand_Fpt_Attribute
procedure Expand_Fpt_Attribute_RR (N : Node_Id) is
E1 : constant Node_Id := First (Expressions (N));
E2 : constant Node_Id := Next (E1);
Ftp : Entity_Id;
Pkg : RE_Id;
begin
Find_Fat_Info (Etype (E1), Ftp, Pkg);
Expand_Fpt_Attribute
(N, Pkg, Attribute_Name (N),
New_List (
Unchecked_Convert_To (Ftp, Relocate_Node (E1)),
Unchecked_Convert_To (Ftp, Relocate_Node (E2))));
end Expand_Fpt_Attribute_RR;
---------------------------------
-- Expand_Loop_Entry_Attribute --
---------------------------------
procedure Expand_Loop_Entry_Attribute (N : Node_Id) is
procedure Build_Conditional_Block
(Loc : Source_Ptr;
Cond : Node_Id;
Loop_Stmt : Node_Id;
If_Stmt : out Node_Id;
Blk_Stmt : out Node_Id);
-- Create a block Blk_Stmt with an empty declarative list and a single
-- loop Loop_Stmt. The block is encased in an if statement If_Stmt with
-- condition Cond. If_Stmt is Empty when there is no condition provided.
function Is_Array_Iteration (N : Node_Id) return Boolean;
-- Determine whether loop statement N denotes an Ada 2012 iteration over
-- an array object.
-----------------------------
-- Build_Conditional_Block --
-----------------------------
procedure Build_Conditional_Block
(Loc : Source_Ptr;
Cond : Node_Id;
Loop_Stmt : Node_Id;
If_Stmt : out Node_Id;
Blk_Stmt : out Node_Id)
is
begin
-- Do not reanalyze the original loop statement because it is simply
-- being relocated.
Set_Analyzed (Loop_Stmt);
Blk_Stmt :=
Make_Block_Statement (Loc,
Declarations => New_List,
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,
Statements => New_List (Loop_Stmt)));
if Present (Cond) then
If_Stmt :=
Make_If_Statement (Loc,
Condition => Cond,
Then_Statements => New_List (Blk_Stmt));
else
If_Stmt := Empty;
end if;
end Build_Conditional_Block;
------------------------
-- Is_Array_Iteration --
------------------------
function Is_Array_Iteration (N : Node_Id) return Boolean is
Stmt : constant Node_Id := Original_Node (N);
Iter : Node_Id;
begin
if Nkind (Stmt) = N_Loop_Statement
and then Present (Iteration_Scheme (Stmt))
and then Present (Iterator_Specification (Iteration_Scheme (Stmt)))
then
Iter := Iterator_Specification (Iteration_Scheme (Stmt));
return
Of_Present (Iter) and then Is_Array_Type (Etype (Name (Iter)));
end if;
return False;
end Is_Array_Iteration;
-- Local variables
Pref : constant Node_Id := Prefix (N);
Base_Typ : constant Entity_Id := Base_Type (Etype (Pref));
Exprs : constant List_Id := Expressions (N);
Aux_Decl : Node_Id;
Blk : Node_Id;
Decls : List_Id;
Installed : Boolean;
Loc : Source_Ptr;
Loop_Id : Entity_Id;
Loop_Stmt : Node_Id;
Result : Node_Id;
Scheme : Node_Id;
Temp_Decl : Node_Id;
Temp_Id : Entity_Id;
-- Start of processing for Expand_Loop_Entry_Attribute
begin
-- Step 1: Find the related loop
-- The loop label variant of attribute 'Loop_Entry already has all the
-- information in its expression.
if Present (Exprs) then
Loop_Id := Entity (First (Exprs));
Loop_Stmt := Label_Construct (Parent (Loop_Id));
-- Climb the parent chain to find the nearest enclosing loop. Skip
-- all internally generated loops for quantified expressions and for
-- element iterators over multidimensional arrays because the pragma
-- applies to source loop.
else
Loop_Stmt := N;
while Present (Loop_Stmt) loop
if Nkind (Loop_Stmt) = N_Loop_Statement
and then Comes_From_Source (Loop_Stmt)
then
exit;
end if;
Loop_Stmt := Parent (Loop_Stmt);
end loop;
Loop_Id := Entity (Identifier (Loop_Stmt));
end if;
Loc := Sloc (Loop_Stmt);
-- Step 2: Transform the loop
-- The loop has already been transformed during the expansion of a prior
-- 'Loop_Entry attribute. Retrieve the declarative list of the block.
if Has_Loop_Entry_Attributes (Loop_Id) then
-- When the related loop name appears as the argument of attribute
-- Loop_Entry, the corresponding label construct is the generated
-- block statement. This is because the expander reuses the label.
if Nkind (Loop_Stmt) = N_Block_Statement then
Decls := Declarations (Loop_Stmt);
-- In all other cases, the loop must appear in the handled sequence
-- of statements of the generated block.
else
pragma Assert
(Nkind (Parent (Loop_Stmt)) = N_Handled_Sequence_Of_Statements
and then
Nkind (Parent (Parent (Loop_Stmt))) = N_Block_Statement);
Decls := Declarations (Parent (Parent (Loop_Stmt)));
end if;
Result := Empty;
-- Transform the loop into a conditional block
else
Set_Has_Loop_Entry_Attributes (Loop_Id);
Scheme := Iteration_Scheme (Loop_Stmt);
-- Infinite loops are transformed into:
-- declare
-- Temp1 : constant <type of Pref1> := <Pref1>;
-- . . .
-- TempN : constant <type of PrefN> := <PrefN>;
-- begin
-- loop
-- <original source statements with attribute rewrites>
-- end loop;
-- end;
if No (Scheme) then
Build_Conditional_Block (Loc,
Cond => Empty,
Loop_Stmt => Relocate_Node (Loop_Stmt),
If_Stmt => Result,
Blk_Stmt => Blk);
Result := Blk;
-- While loops are transformed into:
-- function Fnn return Boolean is
-- begin
-- <condition actions>
-- return <condition>;
-- end Fnn;
-- if Fnn then
-- declare
-- Temp1 : constant <type of Pref1> := <Pref1>;
-- . . .
-- TempN : constant <type of PrefN> := <PrefN>;
-- begin
-- loop
-- <original source statements with attribute rewrites>
-- exit when not Fnn;
-- end loop;
-- end;
-- end if;
-- Note that loops over iterators and containers are already
-- converted into while loops.
elsif Present (Condition (Scheme)) then
declare
Func_Decl : Node_Id;
Func_Id : Entity_Id;
Stmts : List_Id;
begin
-- Wrap the condition of the while loop in a Boolean function.
-- This avoids the duplication of the same code which may lead
-- to gigi issues with respect to multiple declaration of the
-- same entity in the presence of side effects or checks. Note
-- that the condition actions must also be relocated to the
-- wrapping function.
-- Generate:
-- <condition actions>
-- return <condition>;
if Present (Condition_Actions (Scheme)) then
Stmts := Condition_Actions (Scheme);
else
Stmts := New_List;
end if;
Append_To (Stmts,
Make_Simple_Return_Statement (Loc,
Expression => Relocate_Node (Condition (Scheme))));
-- Generate:
-- function Fnn return Boolean is
-- begin
-- <Stmts>
-- end Fnn;
Func_Id := Make_Temporary (Loc, 'F');
Func_Decl :=
Make_Subprogram_Body (Loc,
Specification =>
Make_Function_Specification (Loc,
Defining_Unit_Name => Func_Id,
Result_Definition =>
New_Occurrence_Of (Standard_Boolean, Loc)),
Declarations => Empty_List,
Handled_Statement_Sequence =>
Make_Handled_Sequence_Of_Statements (Loc,
Statements => Stmts));
-- The function is inserted before the related loop. Make sure
-- to analyze it in the context of the loop's enclosing scope.
Push_Scope (Scope (Loop_Id));
Insert_Action (Loop_Stmt, Func_Decl);
Pop_Scope;
-- Transform the original while loop into an infinite loop
-- where the last statement checks the negated condition. This
-- placement ensures that the condition will not be evaluated
-- twice on the first iteration.
Set_Iteration_Scheme (Loop_Stmt, Empty);
Scheme := Empty;
-- Generate:
-- exit when not Fnn;
Append_To (Statements (Loop_Stmt),
Make_Exit_Statement (Loc,
Condition =>
Make_Op_Not (Loc,
Right_Opnd =>
Make_Function_Call (Loc,
Name => New_Occurrence_Of (Func_Id, Loc)))));
Build_Conditional_Block (Loc,
Cond =>
Make_Function_Call (Loc,
Name => New_Occurrence_Of (Func_Id, Loc)),
Loop_Stmt => Relocate_Node (Loop_Stmt),
If_Stmt => Result,
Blk_Stmt => Blk);
end;
-- Ada 2012 iteration over an array is transformed into:
-- if <Array_Nam>'Length (1) > 0
-- and then <Array_Nam>'Length (N) > 0
-- then
-- declare
-- Temp1 : constant <type of Pref1> := <Pref1>;
-- . . .
-- TempN : constant <type of PrefN> := <PrefN>;
-- begin
-- for X in ... loop -- multiple loops depending on dims
-- <original source statements with attribute rewrites>
-- end loop;
-- end;
-- end if;
elsif Is_Array_Iteration (Loop_Stmt) then
declare
Array_Nam : constant Entity_Id :=
Entity (Name (Iterator_Specification
(Iteration_Scheme (Original_Node (Loop_Stmt)))));
Num_Dims : constant Pos :=
Number_Dimensions (Etype (Array_Nam));
Cond : Node_Id := Empty;
Check : Node_Id;
begin
-- Generate a check which determines whether all dimensions of
-- the array are non-null.
for Dim in 1 .. Num_Dims loop
Check :=
Make_Op_Gt (Loc,
Left_Opnd =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Array_Nam, Loc),
Attribute_Name => Name_Length,
Expressions => New_List (
Make_Integer_Literal (Loc, Dim))),
Right_Opnd =>
Make_Integer_Literal (Loc, 0));
if No (Cond) then
Cond := Check;
else
Cond :=
Make_And_Then (Loc,
Left_Opnd => Cond,
Right_Opnd => Check);
end if;
end loop;
Build_Conditional_Block (Loc,
Cond => Cond,
Loop_Stmt => Relocate_Node (Loop_Stmt),
If_Stmt => Result,
Blk_Stmt => Blk);
end;
-- For loops are transformed into:
-- if <Low> <= <High> then
-- declare
-- Temp1 : constant <type of Pref1> := <Pref1>;
-- . . .
-- TempN : constant <type of PrefN> := <PrefN>;
-- begin
-- for <Def_Id> in <Low> .. <High> loop
-- <original source statements with attribute rewrites>
-- end loop;
-- end;
-- end if;
elsif Present (Loop_Parameter_Specification (Scheme)) then
declare
Loop_Spec : constant Node_Id :=
Loop_Parameter_Specification (Scheme);
Cond : Node_Id;
Subt_Def : Node_Id;
begin
Subt_Def := Discrete_Subtype_Definition (Loop_Spec);
-- When the loop iterates over a subtype indication with a
-- range, use the low and high bounds of the subtype itself.
if Nkind (Subt_Def) = N_Subtype_Indication then
Subt_Def := Scalar_Range (Etype (Subt_Def));
end if;
pragma Assert (Nkind (Subt_Def) = N_Range);
-- Generate
-- Low <= High
Cond :=
Make_Op_Le (Loc,
Left_Opnd => New_Copy_Tree (Low_Bound (Subt_Def)),
Right_Opnd => New_Copy_Tree (High_Bound (Subt_Def)));
Build_Conditional_Block (Loc,
Cond => Cond,
Loop_Stmt => Relocate_Node (Loop_Stmt),
If_Stmt => Result,
Blk_Stmt => Blk);
end;
end if;
Decls := Declarations (Blk);
end if;
-- Step 3: Create a constant to capture the value of the prefix at the
-- entry point into the loop.
Temp_Id := Make_Temporary (Loc, 'P');
-- Preserve the tag of the prefix by offering a specific view of the
-- class-wide version of the prefix.
if Is_Tagged_Type (Base_Typ) then
Tagged_Case : declare
CW_Temp : Entity_Id;
CW_Typ : Entity_Id;
begin
-- Generate:
-- CW_Temp : constant Base_Typ'Class := Base_Typ'Class (Pref);
CW_Temp := Make_Temporary (Loc, 'T');
CW_Typ := Class_Wide_Type (Base_Typ);
Aux_Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => CW_Temp,
Constant_Present => True,
Object_Definition => New_Occurrence_Of (CW_Typ, Loc),
Expression =>
Convert_To (CW_Typ, Relocate_Node (Pref)));
Append_To (Decls, Aux_Decl);
-- Generate:
-- Temp : Base_Typ renames Base_Typ (CW_Temp);
Temp_Decl :=
Make_Object_Renaming_Declaration (Loc,
Defining_Identifier => Temp_Id,
Subtype_Mark => New_Occurrence_Of (Base_Typ, Loc),
Name =>
Convert_To (Base_Typ, New_Occurrence_Of (CW_Temp, Loc)));
Append_To (Decls, Temp_Decl);
end Tagged_Case;
-- Untagged case
else
Untagged_Case : declare
Temp_Expr : Node_Id;
begin
Aux_Decl := Empty;
-- Generate a nominal type for the constant when the prefix is of
-- a constrained type. This is achieved by setting the Etype of
-- the relocated prefix to its base type. Since the prefix is now
-- the initialization expression of the constant, its freezing
-- will produce a proper nominal type.
Temp_Expr := Relocate_Node (Pref);
Set_Etype (Temp_Expr, Base_Typ);
-- Generate:
-- Temp : constant Base_Typ := Pref;
Temp_Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Temp_Id,
Constant_Present => True,
Object_Definition => New_Occurrence_Of (Base_Typ, Loc),
Expression => Temp_Expr);
Append_To (Decls, Temp_Decl);
end Untagged_Case;
end if;
-- Step 4: Analyze all bits
Installed := Current_Scope = Scope (Loop_Id);
-- Depending on the pracement of attribute 'Loop_Entry relative to the
-- associated loop, ensure the proper visibility for analysis.
if not Installed then
Push_Scope (Scope (Loop_Id));
end if;
-- The analysis of the conditional block takes care of the constant
-- declaration.
if Present (Result) then
Rewrite (Loop_Stmt, Result);
Analyze (Loop_Stmt);
-- The conditional block was analyzed when a previous 'Loop_Entry was
-- expanded. There is no point in reanalyzing the block, simply analyze
-- the declaration of the constant.
else
if Present (Aux_Decl) then
Analyze (Aux_Decl);
end if;
Analyze (Temp_Decl);
end if;
Rewrite (N, New_Occurrence_Of (Temp_Id, Loc));
Analyze (N);
if not Installed then
Pop_Scope;
end if;
end Expand_Loop_Entry_Attribute;
------------------------------
-- Expand_Min_Max_Attribute --
------------------------------
procedure Expand_Min_Max_Attribute (N : Node_Id) is
begin
-- Min and Max are handled by the back end (except that static cases
-- have already been evaluated during semantic processing, although the
-- back end should not count on this). The one bit of special processing
-- required in the normal case is that these two attributes typically
-- generate conditionals in the code, so check the relevant restriction.
Check_Restriction (No_Implicit_Conditionals, N);
-- In Modify_Tree_For_C mode, we rewrite as an if expression
if Modify_Tree_For_C then
declare
Loc : constant Source_Ptr := Sloc (N);
Typ : constant Entity_Id := Etype (N);
Expr : constant Node_Id := First (Expressions (N));
Left : constant Node_Id := Relocate_Node (Expr);
Right : constant Node_Id := Relocate_Node (Next (Expr));
function Make_Compare (Left, Right : Node_Id) return Node_Id;
-- Returns Left >= Right for Max, Left <= Right for Min
------------------
-- Make_Compare --
------------------
function Make_Compare (Left, Right : Node_Id) return Node_Id is
begin
if Attribute_Name (N) = Name_Max then
return
Make_Op_Ge (Loc,
Left_Opnd => Left,
Right_Opnd => Right);
else
return
Make_Op_Le (Loc,
Left_Opnd => Left,
Right_Opnd => Right);
end if;
end Make_Compare;
-- Start of processing for Min_Max
begin
-- If both Left and Right are side effect free, then we can just
-- use Duplicate_Expr to duplicate the references and return
-- (if Left >=|<= Right then Left else Right)
if Side_Effect_Free (Left) and then Side_Effect_Free (Right) then
Rewrite (N,
Make_If_Expression (Loc,
Expressions => New_List (
Make_Compare (Left, Right),
Duplicate_Subexpr_No_Checks (Left),
Duplicate_Subexpr_No_Checks (Right))));
-- Otherwise we generate declarations to capture the values.
-- The translation is
-- do
-- T1 : constant typ := Left;
-- T2 : constant typ := Right;
-- in
-- (if T1 >=|<= T2 then T1 else T2)
-- end;
else
declare
T1 : constant Entity_Id := Make_Temporary (Loc, 'T', Left);
T2 : constant Entity_Id := Make_Temporary (Loc, 'T', Right);
begin
Rewrite (N,
Make_Expression_With_Actions (Loc,
Actions => New_List (
Make_Object_Declaration (Loc,
Defining_Identifier => T1,
Constant_Present => True,
Object_Definition =>
New_Occurrence_Of (Etype (Left), Loc),
Expression => Relocate_Node (Left)),
Make_Object_Declaration (Loc,
Defining_Identifier => T2,
Constant_Present => True,
Object_Definition =>
New_Occurrence_Of (Etype (Right), Loc),
Expression => Relocate_Node (Right))),
Expression =>
Make_If_Expression (Loc,
Expressions => New_List (
Make_Compare
(New_Occurrence_Of (T1, Loc),
New_Occurrence_Of (T2, Loc)),
New_Occurrence_Of (T1, Loc),
New_Occurrence_Of (T2, Loc)))));
end;
end if;
Analyze_And_Resolve (N, Typ);
end;
end if;
end Expand_Min_Max_Attribute;
----------------------------------
-- Expand_N_Attribute_Reference --
----------------------------------
procedure Expand_N_Attribute_Reference (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
Typ : constant Entity_Id := Etype (N);
Btyp : constant Entity_Id := Base_Type (Typ);
Pref : constant Node_Id := Prefix (N);
Ptyp : constant Entity_Id := Etype (Pref);
Exprs : constant List_Id := Expressions (N);
Id : constant Attribute_Id := Get_Attribute_Id (Attribute_Name (N));
procedure Rewrite_Stream_Proc_Call (Pname : Entity_Id);
-- Rewrites a stream attribute for Read, Write or Output with the
-- procedure call. Pname is the entity for the procedure to call.
------------------------------
-- Rewrite_Stream_Proc_Call --
------------------------------
procedure Rewrite_Stream_Proc_Call (Pname : Entity_Id) is
Item : constant Node_Id := Next (First (Exprs));
Item_Typ : constant Entity_Id := Etype (Item);
Formal : constant Entity_Id := Next_Formal (First_Formal (Pname));
Formal_Typ : constant Entity_Id := Etype (Formal);
Is_Written : constant Boolean := Ekind (Formal) /= E_In_Parameter;
begin
-- The expansion depends on Item, the second actual, which is
-- the object being streamed in or out.
-- If the item is a component of a packed array type, and
-- a conversion is needed on exit, we introduce a temporary to
-- hold the value, because otherwise the packed reference will
-- not be properly expanded.
if Nkind (Item) = N_Indexed_Component
and then Is_Packed (Base_Type (Etype (Prefix (Item))))
and then Base_Type (Item_Typ) /= Base_Type (Formal_Typ)
and then Is_Written
then
declare
Temp : constant Entity_Id := Make_Temporary (Loc, 'V');
Decl : Node_Id;
Assn : Node_Id;
begin
Decl :=
Make_Object_Declaration (Loc,
Defining_Identifier => Temp,
Object_Definition => New_Occurrence_Of (Formal_Typ, Loc));
Set_Etype (Temp, Formal_Typ);
Assn :=
Make_Assignment_Statement (Loc,
Name => New_Copy_Tree (Item),
Expression =>
Unchecked_Convert_To
(Item_Typ, New_Occurrence_Of (Temp, Loc)));
Rewrite (Item, New_Occurrence_Of (Temp, Loc));
Insert_Actions (N,
New_List (
Decl,
Make_Procedure_Call_Statement (Loc,
Name => New_Occurrence_Of (Pname, Loc),
Parameter_Associations => Exprs),
Assn));
Rewrite (N, Make_Null_Statement (Loc));
return;
end;
end if;
-- For the class-wide dispatching cases, and for cases in which
-- the base type of the second argument matches the base type of
-- the corresponding formal parameter (that is to say the stream
-- operation is not inherited), we are all set, and can use the
-- argument unchanged.
if not Is_Class_Wide_Type (Entity (Pref))
and then not Is_Class_Wide_Type (Etype (Item))
and then Base_Type (Item_Typ) /= Base_Type (Formal_Typ)
then
-- Perform a view conversion when either the argument or the
-- formal parameter are of a private type.
if Is_Private_Type (Formal_Typ)
or else Is_Private_Type (Item_Typ)
then
Rewrite (Item,
Unchecked_Convert_To (Formal_Typ, Relocate_Node (Item)));
-- Otherwise perform a regular type conversion to ensure that all
-- relevant checks are installed.
else
Rewrite (Item, Convert_To (Formal_Typ, Relocate_Node (Item)));
end if;
-- For untagged derived types set Assignment_OK, to prevent
-- copies from being created when the unchecked conversion
-- is expanded (which would happen in Remove_Side_Effects
-- if Expand_N_Unchecked_Conversion were allowed to call
-- Force_Evaluation). The copy could violate Ada semantics in
-- cases such as an actual that is an out parameter. Note that
-- this approach is also used in exp_ch7 for calls to controlled
-- type operations to prevent problems with actuals wrapped in
-- unchecked conversions.
if Is_Untagged_Derivation (Etype (Expression (Item))) then
Set_Assignment_OK (Item);
end if;
end if;
-- The stream operation to call may be a renaming created by an
-- attribute definition clause, and may not be frozen yet. Ensure
-- that it has the necessary extra formals.
if not Is_Frozen (Pname) then
Create_Extra_Formals (Pname);
end if;
-- And now rewrite the call
Rewrite (N,
Make_Procedure_Call_Statement (Loc,
Name => New_Occurrence_Of (Pname, Loc),
Parameter_Associations => Exprs));
Analyze (N);
end Rewrite_Stream_Proc_Call;
-- Start of processing for Expand_N_Attribute_Reference
begin
-- Do required validity checking, if enabled. Do not apply check to
-- output parameters of an Asm instruction, since the value of this
-- is not set till after the attribute has been elaborated, and do
-- not apply the check to the arguments of a 'Read or 'Input attribute
-- reference since the scalar argument is an OUT scalar.
if Validity_Checks_On and then Validity_Check_Operands
and then Id /= Attribute_Asm_Output
and then Id /= Attribute_Read
and then Id /= Attribute_Input
then
declare
Expr : Node_Id;
begin
Expr := First (Expressions (N));
while Present (Expr) loop
Ensure_Valid (Expr);
Next (Expr);
end loop;
end;
end if;
-- Ada 2005 (AI-318-02): If attribute prefix is a call to a build-in-
-- place function, then a temporary return object needs to be created
-- and access to it must be passed to the function. Currently we limit
-- such functions to those with inherently limited result subtypes, but
-- eventually we plan to expand the functions that are treated as
-- build-in-place to include other composite result types.
if Ada_Version >= Ada_2005
and then Is_Build_In_Place_Function_Call (Pref)
then
Make_Build_In_Place_Call_In_Anonymous_Context (Pref);
end if;
-- If prefix is a protected type name, this is a reference to the
-- current instance of the type. For a component definition, nothing
-- to do (expansion will occur in the init proc). In other contexts,
-- rewrite into reference to current instance.
if Is_Protected_Self_Reference (Pref)
and then not
(Nkind_In (Parent (N), N_Index_Or_Discriminant_Constraint,
N_Discriminant_Association)
and then Nkind (Parent (Parent (Parent (Parent (N))))) =
N_Component_Definition)
-- No action needed for these attributes since the current instance
-- will be rewritten to be the name of the _object parameter
-- associated with the enclosing protected subprogram (see below).
and then Id /= Attribute_Access
and then Id /= Attribute_Unchecked_Access
and then Id /= Attribute_Unrestricted_Access
then
Rewrite (Pref, Concurrent_Ref (Pref));
Analyze (Pref);
end if;
-- Remaining processing depends on specific attribute
-- Note: individual sections of the following case statement are
-- allowed to assume there is no code after the case statement, and
-- are legitimately allowed to execute return statements if they have
-- nothing more to do.
case Id is
-- Attributes related to Ada 2012 iterators
when Attribute_Constant_Indexing
| Attribute_Default_Iterator
| Attribute_Implicit_Dereference
| Attribute_Iterable
| Attribute_Iterator_Element
| Attribute_Variable_Indexing
=>
null;
-- Internal attributes used to deal with Ada 2012 delayed aspects. These
-- were already rejected by the parser. Thus they shouldn't appear here.
when Internal_Attribute_Id =>
raise Program_Error;
------------
-- Access --
------------
when Attribute_Access
| Attribute_Unchecked_Access
| Attribute_Unrestricted_Access
=>
Access_Cases : declare
Ref_Object : constant Node_Id := Get_Referenced_Object (Pref);
Btyp_DDT : Entity_Id;
function Enclosing_Object (N : Node_Id) return Node_Id;
-- If N denotes a compound name (selected component, indexed
-- component, or slice), returns the name of the outermost such
-- enclosing object. Otherwise returns N. If the object is a
-- renaming, then the renamed object is returned.
----------------------
-- Enclosing_Object --
----------------------
function Enclosing_Object (N : Node_Id) return Node_Id is
Obj_Name : Node_Id;
begin
Obj_Name := N;
while Nkind_In (Obj_Name, N_Selected_Component,
N_Indexed_Component,
N_Slice)
loop
Obj_Name := Prefix (Obj_Name);
end loop;
return Get_Referenced_Object (Obj_Name);
end Enclosing_Object;
-- Local declarations
Enc_Object : constant Node_Id := Enclosing_Object (Ref_Object);
-- Start of processing for Access_Cases
begin
Btyp_DDT := Designated_Type (Btyp);
-- Handle designated types that come from the limited view
if From_Limited_With (Btyp_DDT)
and then Has_Non_Limited_View (Btyp_DDT)
then
Btyp_DDT := Non_Limited_View (Btyp_DDT);
end if;
-- In order to improve the text of error messages, the designated
-- type of access-to-subprogram itypes is set by the semantics as
-- the associated subprogram entity (see sem_attr). Now we replace
-- such node with the proper E_Subprogram_Type itype.
if Id = Attribute_Unrestricted_Access
and then Is_Subprogram (Directly_Designated_Type (Typ))
then
-- The following conditions ensure that this special management
-- is done only for "Address!(Prim'Unrestricted_Access)" nodes.
-- At this stage other cases in which the designated type is
-- still a subprogram (instead of an E_Subprogram_Type) are
-- wrong because the semantics must have overridden the type of
-- the node with the type imposed by the context.
if Nkind (Parent (N)) = N_Unchecked_Type_Conversion
and then Etype (Parent (N)) = RTE (RE_Prim_Ptr)
then
Set_Etype (N, RTE (RE_Prim_Ptr));
else
declare
Subp : constant Entity_Id :=
Directly_Designated_Type (Typ);
Etyp : Entity_Id;
Extra : Entity_Id := Empty;
New_Formal : Entity_Id;
Old_Formal : Entity_Id := First_Formal (Subp);
Subp_Typ : Entity_Id;
begin
Subp_Typ := Create_Itype (E_Subprogram_Type, N);
Set_Etype (Subp_Typ, Etype (Subp));
Set_Returns_By_Ref (Subp_Typ, Returns_By_Ref (Subp));
if Present (Old_Formal) then
New_Formal := New_Copy (Old_Formal);
Set_First_Entity (Subp_Typ, New_Formal);
loop
Set_Scope (New_Formal, Subp_Typ);
Etyp := Etype (New_Formal);
-- Handle itypes. There is no need to duplicate
-- here the itypes associated with record types
-- (i.e the implicit full view of private types).
if Is_Itype (Etyp)
and then Ekind (Base_Type (Etyp)) /= E_Record_Type
then
Extra := New_Copy (Etyp);
Set_Parent (Extra, New_Formal);
Set_Etype (New_Formal, Extra);
Set_Scope (Extra, Subp_Typ);
end if;
Extra := New_Formal;
Next_Formal (Old_Formal);
exit when No (Old_Formal);
Set_Next_Entity (New_Formal,
New_Copy (Old_Formal));
Next_Entity (New_Formal);
end loop;
Set_Next_Entity (New_Formal, Empty);
Set_Last_Entity (Subp_Typ, Extra);
end if;
-- Now that the explicit formals have been duplicated,
-- any extra formals needed by the subprogram must be
-- created.
if Present (Extra) then
Set_Extra_Formal (Extra, Empty);
end if;
Create_Extra_Formals (Subp_Typ);
Set_Directly_Designated_Type (Typ, Subp_Typ);
end;
end if;
end if;
if Is_Access_Protected_Subprogram_Type (Btyp) then
Expand_Access_To_Protected_Op (N, Pref, Typ);
-- If prefix is a type name, this is a reference to the current
-- instance of the type, within its initialization procedure.
elsif Is_Entity_Name (Pref)
and then Is_Type (Entity (Pref))
then
declare
Par : Node_Id;
Formal : Entity_Id;
begin
-- If the current instance name denotes a task type, then
-- the access attribute is rewritten to be the name of the
-- "_task" parameter associated with the task type's task
-- procedure. An unchecked conversion is applied to ensure
-- a type match in cases of expander-generated calls (e.g.
-- init procs).
if Is_Task_Type (Entity (Pref)) then
Formal :=
First_Entity (Get_Task_Body_Procedure (Entity (Pref)));
while Present (Formal) loop
exit when Chars (Formal) = Name_uTask;
Next_Entity (Formal);
end loop;
pragma Assert (Present (Formal));
Rewrite (N,
Unchecked_Convert_To (Typ,
New_Occurrence_Of (Formal, Loc)));
Set_Etype (N, Typ);
elsif Is_Protected_Type (Entity (Pref)) then
-- No action needed for current instance located in a
-- component definition (expansion will occur in the
-- init proc)
if Is_Protected_Type (Current_Scope) then
null;
-- If the current instance reference is located in a
-- protected subprogram or entry then rewrite the access
-- attribute to be the name of the "_object" parameter.
-- An unchecked conversion is applied to ensure a type
-- match in cases of expander-generated calls (e.g. init
-- procs).
-- The code may be nested in a block, so find enclosing
-- scope that is a protected operation.
else
declare
Subp : Entity_Id;
begin
Subp := Current_Scope;
while Ekind_In (Subp, E_Loop, E_Block) loop
Subp := Scope (Subp);
end loop;
Formal :=
First_Entity
(Protected_Body_Subprogram (Subp));
-- For a protected subprogram the _Object parameter
-- is the protected record, so we create an access
-- to it. The _Object parameter of an entry is an
-- address.
if Ekind (Subp) = E_Entry then
Rewrite (N,
Unchecked_Convert_To (Typ,
New_Occurrence_Of (Formal, Loc)));
Set_Etype (N, Typ);
else
Rewrite (N,
Unchecked_Convert_To (Typ,
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Unrestricted_Access,
Prefix =>
New_Occurrence_Of (Formal, Loc))));
Analyze_And_Resolve (N);
end if;
end;
end if;
-- The expression must appear in a default expression,
-- (which in the initialization procedure is the right-hand
-- side of an assignment), and not in a discriminant
-- constraint.
else
Par := Parent (N);
while Present (Par) loop
exit when Nkind (Par) = N_Assignment_Statement;
if Nkind (Par) = N_Component_Declaration then
return;
end if;
Par := Parent (Par);
end loop;
if Present (Par) then
Rewrite (N,
Make_Attribute_Reference (Loc,
Prefix => Make_Identifier (Loc, Name_uInit),
Attribute_Name => Attribute_Name (N)));
Analyze_And_Resolve (N, Typ);
end if;
end if;
end;
-- If the prefix of an Access attribute is a dereference of an
-- access parameter (or a renaming of such a dereference, or a
-- subcomponent of such a dereference) and the context is a
-- general access type (including the type of an object or
-- component with an access_definition, but not the anonymous
-- type of an access parameter or access discriminant), then
-- apply an accessibility check to the access parameter. We used
-- to rewrite the access parameter as a type conversion, but that
-- could only be done if the immediate prefix of the Access
-- attribute was the dereference, and didn't handle cases where
-- the attribute is applied to a subcomponent of the dereference,
-- since there's generally no available, appropriate access type
-- to convert to in that case. The attribute is passed as the
-- point to insert the check, because the access parameter may
-- come from a renaming, possibly in a different scope, and the
-- check must be associated with the attribute itself.
elsif Id = Attribute_Access
and then Nkind (Enc_Object) = N_Explicit_Dereference
and then Is_Entity_Name (Prefix (Enc_Object))
and then (Ekind (Btyp) = E_General_Access_Type
or else Is_Local_Anonymous_Access (Btyp))
and then Ekind (Entity (Prefix (Enc_Object))) in Formal_Kind
and then Ekind (Etype (Entity (Prefix (Enc_Object))))
= E_Anonymous_Access_Type
and then Present (Extra_Accessibility
(Entity (Prefix (Enc_Object))))
then
Apply_Accessibility_Check (Prefix (Enc_Object), Typ, N);
-- Ada 2005 (AI-251): If the designated type is an interface we
-- add an implicit conversion to force the displacement of the
-- pointer to reference the secondary dispatch table.
elsif Is_Interface (Btyp_DDT)
and then (Comes_From_Source (N)
or else Comes_From_Source (Ref_Object)
or else (Nkind (Ref_Object) in N_Has_Chars
and then Chars (Ref_Object) = Name_uInit))
then
if Nkind (Ref_Object) /= N_Explicit_Dereference then
-- No implicit conversion required if types match, or if
-- the prefix is the class_wide_type of the interface. In
-- either case passing an object of the interface type has
-- already set the pointer correctly.
if Btyp_DDT = Etype (Ref_Object)
or else (Is_Class_Wide_Type (Etype (Ref_Object))
and then
Class_Wide_Type (Btyp_DDT) = Etype (Ref_Object))
then
null;
else
Rewrite (Prefix (N),
Convert_To (Btyp_DDT,
New_Copy_Tree (Prefix (N))));
Analyze_And_Resolve (Prefix (N), Btyp_DDT);
end if;
-- When the object is an explicit dereference, convert the
-- dereference's prefix.
else
declare
Obj_DDT : constant Entity_Id :=
Base_Type
(Directly_Designated_Type
(Etype (Prefix (Ref_Object))));
begin
-- No implicit conversion required if designated types
-- match, or if we have an unrestricted access.
if Obj_DDT /= Btyp_DDT
and then Id /= Attribute_Unrestricted_Access
and then not (Is_Class_Wide_Type (Obj_DDT)
and then Etype (Obj_DDT) = Btyp_DDT)
then
Rewrite (N,
Convert_To (Typ,
New_Copy_Tree (Prefix (Ref_Object))));
Analyze_And_Resolve (N, Typ);
end if;
end;
end if;
end if;
end Access_Cases;
--------------
-- Adjacent --
--------------
-- Transforms 'Adjacent into a call to the floating-point attribute
-- function Adjacent in Fat_xxx (where xxx is the root type)
when Attribute_Adjacent =>
Expand_Fpt_Attribute_RR (N);
-------------
-- Address --
-------------
when Attribute_Address => Address : declare
Task_Proc : Entity_Id;
begin
-- If the prefix is a task or a task type, the useful address is that
-- of the procedure for the task body, i.e. the actual program unit.
-- We replace the original entity with that of the procedure.
if Is_Entity_Name (Pref)
and then Is_Task_Type (Entity (Pref))
then
Task_Proc := Next_Entity (Root_Type (Ptyp));
while Present (Task_Proc) loop
exit when Ekind (Task_Proc) = E_Procedure
and then Etype (First_Formal (Task_Proc)) =
Corresponding_Record_Type (Ptyp);
Next_Entity (Task_Proc);
end loop;
if Present (Task_Proc) then
Set_Entity (Pref, Task_Proc);
Set_Etype (Pref, Etype (Task_Proc));
end if;
-- Similarly, the address of a protected operation is the address
-- of the corresponding protected body, regardless of the protected
-- object from which it is selected.
elsif Nkind (Pref) = N_Selected_Component
and then Is_Subprogram (Entity (Selector_Name (Pref)))
and then Is_Protected_Type (Scope (Entity (Selector_Name (Pref))))
then
Rewrite (Pref,
New_Occurrence_Of (
External_Subprogram (Entity (Selector_Name (Pref))), Loc));
elsif Nkind (Pref) = N_Explicit_Dereference
and then Ekind (Ptyp) = E_Subprogram_Type
and then Convention (Ptyp) = Convention_Protected
then
-- The prefix is be a dereference of an access_to_protected_
-- subprogram. The desired address is the second component of
-- the record that represents the access.
declare
Addr : constant Entity_Id := Etype (N);
Ptr : constant Node_Id := Prefix (Pref);
T : constant Entity_Id :=
Equivalent_Type (Base_Type (Etype (Ptr)));
begin
Rewrite (N,
Unchecked_Convert_To (Addr,
Make_Selected_Component (Loc,
Prefix => Unchecked_Convert_To (T, Ptr),
Selector_Name => New_Occurrence_Of (
Next_Entity (First_Entity (T)), Loc))));
Analyze_And_Resolve (N, Addr);
end;
-- Ada 2005 (AI-251): Class-wide interface objects are always
-- "displaced" to reference the tag associated with the interface
-- type. In order to obtain the real address of such objects we
-- generate a call to a run-time subprogram that returns the base
-- address of the object.
-- This processing is not needed in the VM case, where dispatching
-- issues are taken care of by the virtual machine.
elsif Is_Class_Wide_Type (Ptyp)
and then Is_Interface (Ptyp)
and then Tagged_Type_Expansion
and then not (Nkind (Pref) in N_Has_Entity
and then Is_Subprogram (Entity (Pref)))
then
Rewrite (N,
Make_Function_Call (Loc,
Name => New_Occurrence_Of (RTE (RE_Base_Address), Loc),
Parameter_Associations => New_List (
Relocate_Node (N))));
Analyze (N);
return;
end if;
-- Deal with packed array reference, other cases are handled by
-- the back end.
if Involves_Packed_Array_Reference (Pref) then
Expand_Packed_Address_Reference (N);
end if;
end Address;
---------------
-- Alignment --
---------------
when Attribute_Alignment => Alignment : declare
New_Node : Node_Id;
begin
-- For class-wide types, X'Class'Alignment is transformed into a
-- direct reference to the Alignment of the class type, so that the
-- back end does not have to deal with the X'Class'Alignment
-- reference.
if Is_Entity_Name (Pref)
and then Is_Class_Wide_Type (Entity (Pref))
then
Rewrite (Prefix (N), New_Occurrence_Of (Entity (Pref), Loc));
return;
-- For x'Alignment applied to an object of a class wide type,
-- transform X'Alignment into a call to the predefined primitive
-- operation _Alignment applied to X.
elsif Is_Class_Wide_Type (Ptyp) then
New_Node :=
Make_Attribute_Reference (Loc,
Prefix => Pref,
Attribute_Name => Name_Tag);
New_Node := Build_Get_Alignment (Loc, New_Node);
-- Case where the context is a specific integer type with which
-- the original attribute was compatible. The function has a
-- specific type as well, so to preserve the compatibility we
-- must convert explicitly.
if Typ /= Standard_Integer then
New_Node := Convert_To (Typ, New_Node);
end if;
Rewrite (N, New_Node);
Analyze_And_Resolve (N, Typ);
return;
-- For all other cases, we just have to deal with the case of
-- the fact that the result can be universal.
else
Apply_Universal_Integer_Attribute_Checks (N);
end if;
end Alignment;
---------
-- Bit --
---------
-- We compute this if a packed array reference was present, otherwise we
-- leave the computation up to the back end.
when Attribute_Bit =>
if Involves_Packed_Array_Reference (Pref) then
Expand_Packed_Bit_Reference (N);
else
Apply_Universal_Integer_Attribute_Checks (N);
end if;
------------------
-- Bit_Position --
------------------
-- We compute this if a component clause was present, otherwise we leave
-- the computation up to the back end, since we don't know what layout
-- will be chosen.
-- Note that the attribute can apply to a naked record component
-- in generated code (i.e. the prefix is an identifier that
-- references the component or discriminant entity).
when Attribute_Bit_Position => Bit_Position : declare
CE : Entity_Id;
begin
if Nkind (Pref) = N_Identifier then
CE := Entity (Pref);
else
CE := Entity (Selector_Name (Pref));
end if;
if Known_Static_Component_Bit_Offset (CE) then
Rewrite (N,
Make_Integer_Literal (Loc,
Intval => Component_Bit_Offset (CE)));
Analyze_And_Resolve (N, Typ);
else
Apply_Universal_Integer_Attribute_Checks (N);
end if;
end Bit_Position;
------------------
-- Body_Version --
------------------
-- A reference to P'Body_Version or P'Version is expanded to
-- Vnn : Unsigned;
-- pragma Import (C, Vnn, "uuuuT");
-- ...
-- Get_Version_String (Vnn)
-- where uuuu is the unit name (dots replaced by double underscore)
-- and T is B for the cases of Body_Version, or Version applied to a
-- subprogram acting as its own spec, and S for Version applied to a
-- subprogram spec or package. This sequence of code references the
-- unsigned constant created in the main program by the binder.
-- A special exception occurs for Standard, where the string returned
-- is a copy of the library string in gnatvsn.ads.
when Attribute_Body_Version
| Attribute_Version
=>
Version : declare
E : constant Entity_Id := Make_Temporary (Loc, 'V');
Pent : Entity_Id;
S : String_Id;
begin
-- If not library unit, get to containing library unit
Pent := Entity (Pref);
while Pent /= Standard_Standard
and then Scope (Pent) /= Standard_Standard
and then not Is_Child_Unit (Pent)
loop
Pent := Scope (Pent);
end loop;
-- Special case Standard and Standard.ASCII
if Pent = Standard_Standard or else Pent = Standard_ASCII then
Rewrite (N,
Make_String_Literal (Loc,
Strval => Verbose_Library_Version));
-- All other cases
else
-- Build required string constant
Get_Name_String (Get_Unit_Name (Pent));
Start_String;
for J in 1 .. Name_Len - 2 loop
if Name_Buffer (J) = '.' then
Store_String_Chars ("__");
else
Store_String_Char (Get_Char_Code (Name_Buffer (J)));
end if;
end loop;
-- Case of subprogram acting as its own spec, always use body
if Nkind (Declaration_Node (Pent)) in N_Subprogram_Specification
and then Nkind (Parent (Declaration_Node (Pent))) =
N_Subprogram_Body
and then Acts_As_Spec (Parent (Declaration_Node (Pent)))
then
Store_String_Chars ("B");
-- Case of no body present, always use spec
elsif not Unit_Requires_Body (Pent) then
Store_String_Chars ("S");
-- Otherwise use B for Body_Version, S for spec
elsif Id = Attribute_Body_Version then
Store_String_Chars ("B");
else
Store_String_Chars ("S");
end if;
S := End_String;
Lib.Version_Referenced (S);
-- Insert the object declaration
Insert_Actions (N, New_List (
Make_Object_Declaration (Loc,
Defining_Identifier => E,
Object_Definition =>
New_Occurrence_Of (RTE (RE_Unsigned), Loc))));
-- Set entity as imported with correct external name
Set_Is_Imported (E);
Set_Interface_Name (E, Make_String_Literal (Loc, S));
-- Set entity as internal to ensure proper Sprint output of its
-- implicit importation.
Set_Is_Internal (E);
-- And now rewrite original reference
Rewrite (N,
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (RTE (RE_Get_Version_String), Loc),
Parameter_Associations => New_List (
New_Occurrence_Of (E, Loc))));
end if;
Analyze_And_Resolve (N, RTE (RE_Version_String));
end Version;
-------------
-- Ceiling --
-------------
-- Transforms 'Ceiling into a call to the floating-point attribute
-- function Ceiling in Fat_xxx (where xxx is the root type)
when Attribute_Ceiling =>
Expand_Fpt_Attribute_R (N);
--------------
-- Callable --
--------------
-- Transforms 'Callable attribute into a call to the Callable function
when Attribute_Callable =>
-- We have an object of a task interface class-wide type as a prefix
-- to Callable. Generate:
-- callable (Task_Id (Pref._disp_get_task_id));
if Ada_Version >= Ada_2005
and then Ekind (Ptyp) = E_Class_Wide_Type
and then Is_Interface (Ptyp)
and then Is_Task_Interface (Ptyp)
then
Rewrite (N,
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (RTE (RE_Callable), Loc),
Parameter_Associations => New_List (
Make_Unchecked_Type_Conversion (Loc,
Subtype_Mark =>
New_Occurrence_Of (RTE (RO_ST_Task_Id), Loc),
Expression =>
Make_Selected_Component (Loc,
Prefix =>
New_Copy_Tree (Pref),
Selector_Name =>
Make_Identifier (Loc, Name_uDisp_Get_Task_Id))))));
else
Rewrite (N,
Build_Call_With_Task (Pref, RTE (RE_Callable)));
end if;
Analyze_And_Resolve (N, Standard_Boolean);
------------
-- Caller --
------------
-- Transforms 'Caller attribute into a call to either the
-- Task_Entry_Caller or the Protected_Entry_Caller function.
when Attribute_Caller => Caller : declare
Id_Kind : constant Entity_Id := RTE (RO_AT_Task_Id);
Ent : constant Entity_Id := Entity (Pref);
Conctype : constant Entity_Id := Scope (Ent);
Nest_Depth : Integer := 0;
Name : Node_Id;
S : Entity_Id;
begin
-- Protected case
if Is_Protected_Type (Conctype) then
case Corresponding_Runtime_Package (Conctype) is
when System_Tasking_Protected_Objects_Entries =>
Name :=
New_Occurrence_Of
(RTE (RE_Protected_Entry_Caller), Loc);
when System_Tasking_Protected_Objects_Single_Entry =>
Name :=
New_Occurrence_Of
(RTE (RE_Protected_Single_Entry_Caller), Loc);
when others =>
raise Program_Error;
end case;
Rewrite (N,
Unchecked_Convert_To (Id_Kind,
Make_Function_Call (Loc,
Name => Name,
Parameter_Associations => New_List (
New_Occurrence_Of
(Find_Protection_Object (Current_Scope), Loc)))));
-- Task case
else
-- Determine the nesting depth of the E'Caller attribute, that
-- is, how many accept statements are nested within the accept
-- statement for E at the point of E'Caller. The runtime uses
-- this depth to find the specified entry call.
for J in reverse 0 .. Scope_Stack.Last loop
S := Scope_Stack.Table (J).Entity;
-- We should not reach the scope of the entry, as it should
-- already have been checked in Sem_Attr that this attribute
-- reference is within a matching accept statement.
pragma Assert (S /= Conctype);
if S = Ent then
exit;
elsif Is_Entry (S) then
Nest_Depth := Nest_Depth + 1;
end if;
end loop;
Rewrite (N,
Unchecked_Convert_To (Id_Kind,
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (RTE (RE_Task_Entry_Caller), Loc),
Parameter_Associations => New_List (
Make_Integer_Literal (Loc,
Intval => Int (Nest_Depth))))));
end if;
Analyze_And_Resolve (N, Id_Kind);
end Caller;
-------------
-- Compose --
-------------
-- Transforms 'Compose into a call to the floating-point attribute
-- function Compose in Fat_xxx (where xxx is the root type)
-- Note: we strictly should have special code here to deal with the
-- case of absurdly negative arguments (less than Integer'First)
-- which will return a (signed) zero value, but it hardly seems
-- worth the effort. Absurdly large positive arguments will raise
-- constraint error which is fine.
when Attribute_Compose =>
Expand_Fpt_Attribute_RI (N);
-----------------
-- Constrained --
-----------------
when Attribute_Constrained => Constrained : declare
Formal_Ent : constant Entity_Id := Param_Entity (Pref);
function Is_Constrained_Aliased_View (Obj : Node_Id) return Boolean;
-- Ada 2005 (AI-363): Returns True if the object name Obj denotes a
-- view of an aliased object whose subtype is constrained.
---------------------------------
-- Is_Constrained_Aliased_View --
---------------------------------
function Is_Constrained_Aliased_View (Obj : Node_Id) return Boolean is
E : Entity_Id;
begin
if Is_Entity_Name (Obj) then
E := Entity (Obj);
if Present (Renamed_Object (E)) then
return Is_Constrained_Aliased_View (Renamed_Object (E));
else
return Is_Aliased (E) and then Is_Constrained (Etype (E));
end if;
else
return Is_Aliased_View (Obj)
and then
(Is_Constrained (Etype (Obj))
or else
(Nkind (Obj) = N_Explicit_Dereference
and then
not Object_Type_Has_Constrained_Partial_View
(Typ => Base_Type (Etype (Obj)),
Scop => Current_Scope)));
end if;
end Is_Constrained_Aliased_View;
-- Start of processing for Constrained
begin
-- Reference to a parameter where the value is passed as an extra
-- actual, corresponding to the extra formal referenced by the
-- Extra_Constrained field of the corresponding formal. If this
-- is an entry in-parameter, it is replaced by a constant renaming
-- for which Extra_Constrained is never created.
if Present (Formal_Ent)
and then Ekind (Formal_Ent) /= E_Constant
and then Present (Extra_Constrained (Formal_Ent))
then
Rewrite (N,
New_Occurrence_Of
(Extra_Constrained (Formal_Ent), Sloc (N)));
-- For variables with a Extra_Constrained field, we use the
-- corresponding entity.
elsif Nkind (Pref) = N_Identifier
and then Ekind (Entity (Pref)) = E_Variable
and then Present (Extra_Constrained (Entity (Pref)))
then
Rewrite (N,
New_Occurrence_Of
(Extra_Constrained (Entity (Pref)), Sloc (N)));
-- For all other entity names, we can tell at compile time
elsif Is_Entity_Name (Pref) then
declare
Ent : constant Entity_Id := Entity (Pref);
Res : Boolean;
begin
-- (RM J.4) obsolescent cases
if Is_Type (Ent) then
-- Private type
if Is_Private_Type (Ent) then
Res := not Has_Discriminants (Ent)
or else Is_Constrained (Ent);
-- It not a private type, must be a generic actual type
-- that corresponded to a private type. We know that this
-- correspondence holds, since otherwise the reference
-- within the generic template would have been illegal.
else
if Is_Composite_Type (Underlying_Type (Ent)) then
Res := Is_Constrained (Ent);
else
Res := True;
end if;
end if;
else
-- For access type, apply access check as needed
if Is_Access_Type (Ptyp) then
Apply_Access_Check (N);
end if;
-- If the prefix is not a variable or is aliased, then
-- definitely true; if it's a formal parameter without an
-- associated extra formal, then treat it as constrained.
-- Ada 2005 (AI-363): An aliased prefix must be known to be
-- constrained in order to set the attribute to True.
if not Is_Variable (Pref)
or else Present (Formal_Ent)
or else (Ada_Version < Ada_2005
and then Is_Aliased_View (Pref))
or else (Ada_Version >= Ada_2005
and then Is_Constrained_Aliased_View (Pref))
then
Res := True;
-- Variable case, look at type to see if it is constrained.
-- Note that the one case where this is not accurate (the
-- procedure formal case), has been handled above.
-- We use the Underlying_Type here (and below) in case the
-- type is private without discriminants, but the full type
-- has discriminants. This case is illegal, but we generate
-- it internally for passing to the Extra_Constrained
-- parameter.
else
-- In Ada 2012, test for case of a limited tagged type,
-- in which case the attribute is always required to
-- return True. The underlying type is tested, to make
-- sure we also return True for cases where there is an
-- unconstrained object with an untagged limited partial
-- view which has defaulted discriminants (such objects
-- always produce a False in earlier versions of
-- Ada). (Ada 2012: AI05-0214)
Res :=
Is_Constrained (Underlying_Type (Etype (Ent)))
or else
(Ada_Version >= Ada_2012
and then Is_Tagged_Type (Underlying_Type (Ptyp))
and then Is_Limited_Type (Ptyp));
end if;
end if;
Rewrite (N, New_Occurrence_Of (Boolean_Literals (Res), Loc));
end;
-- Prefix is not an entity name. These are also cases where we can
-- always tell at compile time by looking at the form and type of the
-- prefix. If an explicit dereference of an object with constrained
-- partial view, this is unconstrained (Ada 2005: AI95-0363). If the
-- underlying type is a limited tagged type, then Constrained is
-- required to always return True (Ada 2012: AI05-0214).
else
Rewrite (N,
New_Occurrence_Of (
Boolean_Literals (
not Is_Variable (Pref)
or else
(Nkind (Pref) = N_Explicit_Dereference
and then
not Object_Type_Has_Constrained_Partial_View
(Typ => Base_Type (Ptyp),
Scop => Current_Scope))
or else Is_Constrained (Underlying_Type (Ptyp))
or else (Ada_Version >= Ada_2012
and then Is_Tagged_Type (Underlying_Type (Ptyp))
and then Is_Limited_Type (Ptyp))),
Loc));
end if;
Analyze_And_Resolve (N, Standard_Boolean);
end Constrained;
---------------
-- Copy_Sign --
---------------
-- Transforms 'Copy_Sign into a call to the floating-point attribute
-- function Copy_Sign in Fat_xxx (where xxx is the root type)
when Attribute_Copy_Sign =>
Expand_Fpt_Attribute_RR (N);
-----------
-- Count --
-----------
-- Transforms 'Count attribute into a call to the Count function
when Attribute_Count => Count : declare
Call : Node_Id;
Conctyp : Entity_Id;
Entnam : Node_Id;
Entry_Id : Entity_Id;
Index : Node_Id;
Name : Node_Id;
begin
-- If the prefix is a member of an entry family, retrieve both
-- entry name and index. For a simple entry there is no index.
if Nkind (Pref) = N_Indexed_Component then
Entnam := Prefix (Pref);
Index := First (Expressions (Pref));
else
Entnam := Pref;
Index := Empty;
end if;
Entry_Id := Entity (Entnam);
-- Find the concurrent type in which this attribute is referenced
-- (there had better be one).
Conctyp := Current_Scope;
while not Is_Concurrent_Type (Conctyp) loop
Conctyp := Scope (Conctyp);
end loop;
-- Protected case
if Is_Protected_Type (Conctyp) then
case Corresponding_Runtime_Package (Conctyp) is
when System_Tasking_Protected_Objects_Entries =>
Name := New_Occurrence_Of (RTE (RE_Protected_Count), Loc);
Call :=
Make_Function_Call (Loc,
Name => Name,
Parameter_Associations => New_List (
New_Occurrence_Of
(Find_Protection_Object (Current_Scope), Loc),
Entry_Index_Expression
(Loc, Entry_Id, Index, Scope (Entry_Id))));
when System_Tasking_Protected_Objects_Single_Entry =>
Name :=
New_Occurrence_Of (RTE (RE_Protected_Count_Entry), Loc);
Call :=
Make_Function_Call (Loc,
Name => Name,
Parameter_Associations => New_List (
New_Occurrence_Of
(Find_Protection_Object (Current_Scope), Loc)));
when others =>
raise Program_Error;
end case;
-- Task case
else
Call :=
Make_Function_Call (Loc,
Name => New_Occurrence_Of (RTE (RE_Task_Count), Loc),
Parameter_Associations => New_List (
Entry_Index_Expression (Loc,
Entry_Id, Index, Scope (Entry_Id))));
end if;
-- The call returns type Natural but the context is universal integer
-- so any integer type is allowed. The attribute was already resolved
-- so its Etype is the required result type. If the base type of the
-- context type is other than Standard.Integer we put in a conversion
-- to the required type. This can be a normal typed conversion since
-- both input and output types of the conversion are integer types
if Base_Type (Typ) /= Base_Type (Standard_Integer) then
Rewrite (N, Convert_To (Typ, Call));
else
Rewrite (N, Call);
end if;
Analyze_And_Resolve (N, Typ);
end Count;
---------------------
-- Descriptor_Size --
---------------------
when Attribute_Descriptor_Size =>
-- Attribute Descriptor_Size is handled by the back end when applied
-- to an unconstrained array type.
if Is_Array_Type (Ptyp)
and then not Is_Constrained (Ptyp)
then
Apply_Universal_Integer_Attribute_Checks (N);
-- For any other type, the descriptor size is 0 because there is no
-- actual descriptor, but the result is not formally static.
else
Rewrite (N, Make_Integer_Literal (Loc, 0));
Analyze (N);
Set_Is_Static_Expression (N, False);
end if;
---------------
-- Elab_Body --
---------------
-- This processing is shared by Elab_Spec
-- What we do is to insert the following declarations
-- procedure tnn;
-- pragma Import (C, enn, "name___elabb/s");
-- and then the Elab_Body/Spec attribute is replaced by a reference
-- to this defining identifier.
when Attribute_Elab_Body
| Attribute_Elab_Spec
=>
-- Leave attribute unexpanded in CodePeer mode: the gnat2scil
-- back-end knows how to handle these attributes directly.
if CodePeer_Mode then
return;
end if;
Elab_Body : declare
Ent : constant Entity_Id := Make_Temporary (Loc, 'E');
Str : String_Id;
Lang : Node_Id;
procedure Make_Elab_String (Nod : Node_Id);
-- Given Nod, an identifier, or a selected component, put the
-- image into the current string literal, with double underline
-- between components.
----------------------
-- Make_Elab_String --
----------------------
procedure Make_Elab_String (Nod : Node_Id) is
begin
if Nkind (Nod) = N_Selected_Component then
Make_Elab_String (Prefix (Nod));
Store_String_Char ('_');
Store_String_Char ('_');
Get_Name_String (Chars (Selector_Name (Nod)));
else
pragma Assert (Nkind (Nod) = N_Identifier);
Get_Name_String (Chars (Nod));
end if;
Store_String_Chars (Name_Buffer (1 .. Name_Len));
end Make_Elab_String;
-- Start of processing for Elab_Body/Elab_Spec
begin
-- First we need to prepare the string literal for the name of
-- the elaboration routine to be referenced.
Start_String;
Make_Elab_String (Pref);
Store_String_Chars ("___elab");
Lang := Make_Identifier (Loc, Name_C);
if Id = Attribute_Elab_Body then
Store_String_Char ('b');
else
Store_String_Char ('s');
end if;
Str := End_String;
Insert_Actions (N, New_List (
Make_Subprogram_Declaration (Loc,
Specification =>
Make_Procedure_Specification (Loc,
Defining_Unit_Name => Ent)),
Make_Pragma (Loc,
Chars => Name_Import,
Pragma_Argument_Associations => New_List (
Make_Pragma_Argument_Association (Loc, Expression => Lang),
Make_Pragma_Argument_Association (Loc,
Expression => Make_Identifier (Loc, Chars (Ent))),
Make_Pragma_Argument_Association (Loc,
Expression => Make_String_Literal (Loc, Str))))));
Set_Entity (N, Ent);
Rewrite (N, New_Occurrence_Of (Ent, Loc));
end Elab_Body;
--------------------
-- Elab_Subp_Body --
--------------------
-- Always ignored. In CodePeer mode, gnat2scil knows how to handle
-- this attribute directly, and if we are not in CodePeer mode it is
-- entirely ignored ???
when Attribute_Elab_Subp_Body =>
return;
----------------
-- Elaborated --
----------------
-- Elaborated is always True for preelaborated units, predefined units,
-- pure units and units which have Elaborate_Body pragmas. These units
-- have no elaboration entity.
-- Note: The Elaborated attribute is never passed to the back end
when Attribute_Elaborated => Elaborated : declare
Ent : constant Entity_Id := Entity (Pref);
begin
if Present (Elaboration_Entity (Ent)) then
Rewrite (N,
Make_Op_Ne (Loc,
Left_Opnd =>
New_Occurrence_Of (Elaboration_Entity (Ent), Loc),
Right_Opnd =>
Make_Integer_Literal (Loc, Uint_0)));
Analyze_And_Resolve (N, Typ);
else
Rewrite (N, New_Occurrence_Of (Standard_True, Loc));
end if;
end Elaborated;
--------------
-- Enum_Rep --
--------------
when Attribute_Enum_Rep => Enum_Rep : declare
Expr : Node_Id;
begin
-- Get the expression, which is X for Enum_Type'Enum_Rep (X) or
-- X'Enum_Rep.
if Is_Non_Empty_List (Exprs) then
Expr := First (Exprs);
else
Expr := Pref;
end if;
-- If the expression is an enumeration literal, it is replaced by the
-- literal value.
if Nkind (Expr) in N_Has_Entity
and then Ekind (Entity (Expr)) = E_Enumeration_Literal
then
Rewrite (N,
Make_Integer_Literal (Loc, Enumeration_Rep (Entity (Expr))));
-- If this is a renaming of a literal, recover the representation
-- of the original. If it renames an expression there is nothing to
-- fold.
elsif Nkind (Expr) in N_Has_Entity
and then Ekind (Entity (Expr)) = E_Constant
and then Present (Renamed_Object (Entity (Expr)))
and then Is_Entity_Name (Renamed_Object (Entity (Expr)))
and then Ekind (Entity (Renamed_Object (Entity (Expr)))) =
E_Enumeration_Literal
then
Rewrite (N,
Make_Integer_Literal (Loc,
Enumeration_Rep (Entity (Renamed_Object (Entity (Expr))))));
-- If not constant-folded above, Enum_Type'Enum_Rep (X) or
-- X'Enum_Rep expands to
-- target-type (X)
-- This is simply a direct conversion from the enumeration type to
-- the target integer type, which is treated by the back end as a
-- normal integer conversion, treating the enumeration type as an
-- integer, which is exactly what we want. We set Conversion_OK to
-- make sure that the analyzer does not complain about what otherwise
-- might be an illegal conversion.
else
Rewrite (N, OK_Convert_To (Typ, Relocate_Node (Expr)));
end if;
Set_Etype (N, Typ);
Analyze_And_Resolve (N, Typ);
end Enum_Rep;
--------------
-- Enum_Val --
--------------
when Attribute_Enum_Val => Enum_Val : declare
Expr : Node_Id;
Btyp : constant Entity_Id := Base_Type (Ptyp);
begin
-- X'Enum_Val (Y) expands to
-- [constraint_error when _rep_to_pos (Y, False) = -1, msg]
-- X!(Y);
Expr := Unchecked_Convert_To (Ptyp, First (Exprs));
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Op_Eq (Loc,
Left_Opnd =>
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (TSS (Btyp, TSS_Rep_To_Pos), Loc),
Parameter_Associations => New_List (
Relocate_Node (Duplicate_Subexpr (Expr)),
New_Occurrence_Of (Standard_False, Loc))),
Right_Opnd => Make_Integer_Literal (Loc, -1)),
Reason => CE_Range_Check_Failed));
Rewrite (N, Expr);
Analyze_And_Resolve (N, Ptyp);
end Enum_Val;
--------------
-- Exponent --
--------------
-- Transforms 'Exponent into a call to the floating-point attribute
-- function Exponent in Fat_xxx (where xxx is the root type)
when Attribute_Exponent =>
Expand_Fpt_Attribute_R (N);
------------------
-- External_Tag --
------------------
-- transforme X'External_Tag into Ada.Tags.External_Tag (X'tag)
when Attribute_External_Tag =>
Rewrite (N,
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (RTE (RE_External_Tag), Loc),
Parameter_Associations => New_List (
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Tag,
Prefix => Prefix (N)))));
Analyze_And_Resolve (N, Standard_String);
-----------------------
-- Finalization_Size --
-----------------------
when Attribute_Finalization_Size => Finalization_Size : declare
function Calculate_Header_Size return Node_Id;
-- Generate a runtime call to calculate the size of the hidden header
-- along with any added padding which would precede a heap-allocated
-- object of the prefix type.
---------------------------
-- Calculate_Header_Size --
---------------------------
function Calculate_Header_Size return Node_Id is
begin
-- Generate:
-- Universal_Integer
-- (Header_Size_With_Padding (Pref'Alignment))
return
Convert_To (Universal_Integer,
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (RTE (RE_Header_Size_With_Padding), Loc),
Parameter_Associations => New_List (
Make_Attribute_Reference (Loc,
Prefix => New_Copy_Tree (Pref),
Attribute_Name => Name_Alignment))));
end Calculate_Header_Size;
-- Local variables
Size : Entity_Id;
-- Start of Finalization_Size
begin
-- An object of a class-wide type first requires a runtime check to
-- determine whether it is actually controlled or not. Depending on
-- the outcome of this check, the Finalization_Size of the object
-- may be zero or some positive value.
--
-- In this scenario, Pref'Finalization_Size is expanded into
--
-- Size : Integer := 0;
--
-- if Needs_Finalization (Pref'Tag) then
-- Size :=
-- Universal_Integer
-- (Header_Size_With_Padding (Pref'Alignment));
-- end if;
--
-- and the attribute reference is replaced with a reference to Size.
if Is_Class_Wide_Type (Ptyp) then
Size := Make_Temporary (Loc, 'S');
Insert_Actions (N, New_List (
-- Generate:
-- Size : Integer := 0;
Make_Object_Declaration (Loc,
Defining_Identifier => Size,
Object_Definition =>
New_Occurrence_Of (Standard_Integer, Loc),
Expression => Make_Integer_Literal (Loc, 0)),
-- Generate:
-- if Needs_Finalization (Pref'Tag) then
-- Size :=
-- Universal_Integer
-- (Header_Size_With_Padding (Pref'Alignment));
-- end if;
Make_If_Statement (Loc,
Condition =>
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (RTE (RE_Needs_Finalization), Loc),
Parameter_Associations => New_List (
Make_Attribute_Reference (Loc,
Prefix => New_Copy_Tree (Pref),
Attribute_Name => Name_Tag))),
Then_Statements => New_List (
Make_Assignment_Statement (Loc,
Name => New_Occurrence_Of (Size, Loc),
Expression => Calculate_Header_Size)))));
Rewrite (N, New_Occurrence_Of (Size, Loc));
-- The prefix is known to be controlled at compile time. Calculate
-- Finalization_Size by calling function Header_Size_With_Padding.
elsif Needs_Finalization (Ptyp) then
Rewrite (N, Calculate_Header_Size);
-- The prefix is not an object with controlled parts, so its
-- Finalization_Size is zero.
else
Rewrite (N, Make_Integer_Literal (Loc, 0));
end if;
-- Due to cases where the entity type of the attribute is already
-- resolved the rewritten N must get re-resolved to its appropriate
-- type.
Analyze_And_Resolve (N, Typ);
end Finalization_Size;
-----------
-- First --
-----------
when Attribute_First =>
-- If the prefix type is a constrained packed array type which
-- already has a Packed_Array_Impl_Type representation defined, then
-- replace this attribute with a direct reference to 'First of the
-- appropriate index subtype (since otherwise the back end will try
-- to give us the value of 'First for this implementation type).
if Is_Constrained_Packed_Array (Ptyp) then
Rewrite (N,
Make_Attribute_Reference (Loc,
Attribute_Name => Name_First,
Prefix =>
New_Occurrence_Of (Get_Index_Subtype (N), Loc)));
Analyze_And_Resolve (N, Typ);
-- For access type, apply access check as needed
elsif Is_Access_Type (Ptyp) then
Apply_Access_Check (N);
-- For scalar type, if low bound is a reference to an entity, just
-- replace with a direct reference. Note that we can only have a
-- reference to a constant entity at this stage, anything else would
-- have already been rewritten.
elsif Is_Scalar_Type (Ptyp) then
declare
Lo : constant Node_Id := Type_Low_Bound (Ptyp);
begin
if Is_Entity_Name (Lo) then
Rewrite (N, New_Occurrence_Of (Entity (Lo), Loc));
end if;
end;
end if;
---------------
-- First_Bit --
---------------
-- Compute this if component clause was present, otherwise we leave the
-- computation to be completed in the back-end, since we don't know what
-- layout will be chosen.
when Attribute_First_Bit => First_Bit_Attr : declare
CE : constant Entity_Id := Entity (Selector_Name (Pref));
begin
-- In Ada 2005 (or later) if we have the non-default bit order, then
-- we return the original value as given in the component clause
-- (RM 2005 13.5.2(3/2)).
if Present (Component_Clause (CE))
and then Ada_Version >= Ada_2005
and then Reverse_Bit_Order (Scope (CE))
then
Rewrite (N,
Make_Integer_Literal (Loc,
Intval => Expr_Value (First_Bit (Component_Clause (CE)))));
Analyze_And_Resolve (N, Typ);
-- Otherwise (Ada 83/95 or Ada 2005 or later with default bit order),
-- rewrite with normalized value if we know it statically.
elsif Known_Static_Component_Bit_Offset (CE) then
Rewrite (N,
Make_Integer_Literal (Loc,
Component_Bit_Offset (CE) mod System_Storage_Unit));
Analyze_And_Resolve (N, Typ);
-- Otherwise left to back end, just do universal integer checks
else
Apply_Universal_Integer_Attribute_Checks (N);
end if;
end First_Bit_Attr;
-----------------
-- Fixed_Value --
-----------------
-- We transform:
-- fixtype'Fixed_Value (integer-value)
-- into
-- fixtype(integer-value)
-- We do all the required analysis of the conversion here, because we do
-- not want this to go through the fixed-point conversion circuits. Note
-- that the back end always treats fixed-point as equivalent to the
-- corresponding integer type anyway.
when Attribute_Fixed_Value =>
Rewrite (N,
Make_Type_Conversion (Loc,
Subtype_Mark => New_Occurrence_Of (Entity (Pref), Loc),
Expression => Relocate_Node (First (Exprs))));
Set_Etype (N, Entity (Pref));
Set_Analyzed (N);
-- Note: it might appear that a properly analyzed unchecked
-- conversion would be just fine here, but that's not the case,
-- since the full range checks performed by the following call
-- are critical.
Apply_Type_Conversion_Checks (N);
-----------
-- Floor --
-----------
-- Transforms 'Floor into a call to the floating-point attribute
-- function Floor in Fat_xxx (where xxx is the root type)
when Attribute_Floor =>
Expand_Fpt_Attribute_R (N);
----------
-- Fore --
----------
-- For the fixed-point type Typ:
-- Typ'Fore
-- expands into
-- Result_Type (System.Fore (Universal_Real (Type'First)),
-- Universal_Real (Type'Last))
-- Note that we know that the type is a non-static subtype, or Fore
-- would have itself been computed dynamically in Eval_Attribute.
when Attribute_Fore =>
Rewrite (N,
Convert_To (Typ,
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (RTE (RE_Fore), Loc),
Parameter_Associations => New_List (
Convert_To (Universal_Real,
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Ptyp, Loc),
Attribute_Name => Name_First)),
Convert_To (Universal_Real,
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Ptyp, Loc),
Attribute_Name => Name_Last))))));
Analyze_And_Resolve (N, Typ);
--------------
-- Fraction --
--------------
-- Transforms 'Fraction into a call to the floating-point attribute
-- function Fraction in Fat_xxx (where xxx is the root type)
when Attribute_Fraction =>
Expand_Fpt_Attribute_R (N);
--------------
-- From_Any --
--------------
when Attribute_From_Any => From_Any : declare
P_Type : constant Entity_Id := Etype (Pref);
Decls : constant List_Id := New_List;
begin
Rewrite (N,
Build_From_Any_Call (P_Type,
Relocate_Node (First (Exprs)),
Decls));
Insert_Actions (N, Decls);
Analyze_And_Resolve (N, P_Type);
end From_Any;
----------------------
-- Has_Same_Storage --
----------------------
when Attribute_Has_Same_Storage => Has_Same_Storage : declare
Loc : constant Source_Ptr := Sloc (N);
X : constant Node_Id := Prefix (N);
Y : constant Node_Id := First (Expressions (N));
-- The arguments
X_Addr : Node_Id;
Y_Addr : Node_Id;
-- Rhe expressions for their addresses
X_Size : Node_Id;
Y_Size : Node_Id;
-- Rhe expressions for their sizes
begin
-- The attribute is expanded as:
-- (X'address = Y'address)
-- and then (X'Size = Y'Size)
-- If both arguments have the same Etype the second conjunct can be
-- omitted.
X_Addr :=
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Address,
Prefix => New_Copy_Tree (X));
Y_Addr :=
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Address,
Prefix => New_Copy_Tree (Y));
X_Size :=
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Size,
Prefix => New_Copy_Tree (X));
Y_Size :=
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Size,
Prefix => New_Copy_Tree (Y));
if Etype (X) = Etype (Y) then
Rewrite (N,
Make_Op_Eq (Loc,
Left_Opnd => X_Addr,
Right_Opnd => Y_Addr));
else
Rewrite (N,
Make_Op_And (Loc,
Left_Opnd =>
Make_Op_Eq (Loc,
Left_Opnd => X_Addr,
Right_Opnd => Y_Addr),
Right_Opnd =>
Make_Op_Eq (Loc,
Left_Opnd => X_Size,
Right_Opnd => Y_Size)));
end if;
Analyze_And_Resolve (N, Standard_Boolean);
end Has_Same_Storage;
--------------
-- Identity --
--------------
-- For an exception returns a reference to the exception data:
-- Exception_Id!(Prefix'Reference)
-- For a task it returns a reference to the _task_id component of
-- corresponding record:
-- taskV!(Prefix)._Task_Id, converted to the type Task_Id defined
-- in Ada.Task_Identification
when Attribute_Identity => Identity : declare
Id_Kind : Entity_Id;
begin
if Ptyp = Standard_Exception_Type then
Id_Kind := RTE (RE_Exception_Id);
if Present (Renamed_Object (Entity (Pref))) then
Set_Entity (Pref, Renamed_Object (Entity (Pref)));
end if;
Rewrite (N,
Unchecked_Convert_To (Id_Kind, Make_Reference (Loc, Pref)));
else
Id_Kind := RTE (RO_AT_Task_Id);
-- If the prefix is a task interface, the Task_Id is obtained
-- dynamically through a dispatching call, as for other task
-- attributes applied to interfaces.
if Ada_Version >= Ada_2005
and then Ekind (Ptyp) = E_Class_Wide_Type
and then Is_Interface (Ptyp)
and then Is_Task_Interface (Ptyp)
then
Rewrite (N,
Unchecked_Convert_To (Id_Kind,
Make_Selected_Component (Loc,
Prefix =>
New_Copy_Tree (Pref),
Selector_Name =>
Make_Identifier (Loc, Name_uDisp_Get_Task_Id))));
else
Rewrite (N,
Unchecked_Convert_To (Id_Kind, Concurrent_Ref (Pref)));
end if;
end if;
Analyze_And_Resolve (N, Id_Kind);
end Identity;
-----------
-- Image --
-----------
-- Image attribute is handled in separate unit Exp_Imgv
when Attribute_Image =>
Exp_Imgv.Expand_Image_Attribute (N);
---------
-- Img --
---------
-- X'Img is expanded to typ'Image (X), where typ is the type of X
when Attribute_Img =>
Rewrite (N,
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Ptyp, Loc),
Attribute_Name => Name_Image,
Expressions => New_List (Relocate_Node (Pref))));
Analyze_And_Resolve (N, Standard_String);
-----------
-- Input --
-----------
when Attribute_Input => Input : declare
P_Type : constant Entity_Id := Entity (Pref);
B_Type : constant Entity_Id := Base_Type (P_Type);
U_Type : constant Entity_Id := Underlying_Type (P_Type);
Strm : constant Node_Id := First (Exprs);
Fname : Entity_Id;
Decl : Node_Id;
Call : Node_Id;
Prag : Node_Id;
Arg2 : Node_Id;
Rfunc : Node_Id;
Cntrl : Node_Id := Empty;
-- Value for controlling argument in call. Always Empty except in
-- the dispatching (class-wide type) case, where it is a reference
-- to the dummy object initialized to the right internal tag.
procedure Freeze_Stream_Subprogram (F : Entity_Id);
-- The expansion of the attribute reference may generate a call to
-- a user-defined stream subprogram that is frozen by the call. This
-- can lead to access-before-elaboration problem if the reference
-- appears in an object declaration and the subprogram body has not
-- been seen. The freezing of the subprogram requires special code
-- because it appears in an expanded context where expressions do
-- not freeze their constituents.
------------------------------
-- Freeze_Stream_Subprogram --
------------------------------
procedure Freeze_Stream_Subprogram (F : Entity_Id) is
Decl : constant Node_Id := Unit_Declaration_Node (F);
Bod : Node_Id;
begin
-- If this is user-defined subprogram, the corresponding
-- stream function appears as a renaming-as-body, and the
-- user subprogram must be retrieved by tree traversal.
if Present (Decl)
and then Nkind (Decl) = N_Subprogram_Declaration
and then Present (Corresponding_Body (Decl))
then
Bod := Corresponding_Body (Decl);
if Nkind (Unit_Declaration_Node (Bod)) =
N_Subprogram_Renaming_Declaration
then
Set_Is_Frozen (Entity (Name (Unit_Declaration_Node (Bod))));
end if;
end if;
end Freeze_Stream_Subprogram;
-- Start of processing for Input
begin
-- If no underlying type, we have an error that will be diagnosed
-- elsewhere, so here we just completely ignore the expansion.
if No (U_Type) then
return;
end if;
-- Stream operations can appear in user code even if the restriction
-- No_Streams is active (for example, when instantiating a predefined
-- container). In that case rewrite the attribute as a Raise to
-- prevent any run-time use.
if Restriction_Active (No_Streams) then
Rewrite (N,
Make_Raise_Program_Error (Sloc (N),
Reason => PE_Stream_Operation_Not_Allowed));
Set_Etype (N, B_Type);
return;
end if;
-- If there is a TSS for Input, just call it
Fname := Find_Stream_Subprogram (P_Type, TSS_Stream_Input);
if Present (Fname) then
null;
else
-- If there is a Stream_Convert pragma, use it, we rewrite
-- sourcetyp'Input (stream)
-- as
-- sourcetyp (streamread (strmtyp'Input (stream)));
-- where streamread is the given Read function that converts an
-- argument of type strmtyp to type sourcetyp or a type from which
-- it is derived (extra conversion required for the derived case).
Prag := Get_Stream_Convert_Pragma (P_Type);
if Present (Prag) then
Arg2 := Next (First (Pragma_Argument_Associations (Prag)));
Rfunc := Entity (Expression (Arg2));
Rewrite (N,
Convert_To (B_Type,
Make_Function_Call (Loc,
Name => New_Occurrence_Of (Rfunc, Loc),
Parameter_Associations => New_List (
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of
(Etype (First_Formal (Rfunc)), Loc),
Attribute_Name => Name_Input,
Expressions => Exprs)))));
Analyze_And_Resolve (N, B_Type);
return;
-- Elementary types
elsif Is_Elementary_Type (U_Type) then
-- A special case arises if we have a defined _Read routine,
-- since in this case we are required to call this routine.
declare
Typ : Entity_Id := P_Type;
begin
if Present (Full_View (Typ)) then
Typ := Full_View (Typ);
end if;
if Present (TSS (Base_Type (Typ), TSS_Stream_Read)) then
Build_Record_Or_Elementary_Input_Function
(Loc, Typ, Decl, Fname, Use_Underlying => False);
Insert_Action (N, Decl);
-- For normal cases, we call the I_xxx routine directly
else
Rewrite (N, Build_Elementary_Input_Call (N));
Analyze_And_Resolve (N, P_Type);
return;
end if;
end;
-- Array type case
elsif Is_Array_Type (U_Type) then
Build_Array_Input_Function (Loc, U_Type, Decl, Fname);
Compile_Stream_Body_In_Scope (N, Decl, U_Type, Check => False);
-- Dispatching case with class-wide type
elsif Is_Class_Wide_Type (P_Type) then
-- No need to do anything else compiling under restriction
-- No_Dispatching_Calls. During the semantic analysis we
-- already notified such violation.
if Restriction_Active (No_Dispatching_Calls) then
return;
end if;
declare
Rtyp : constant Entity_Id := Root_Type (P_Type);
Expr : Node_Id;
begin
-- Read the internal tag (RM 13.13.2(34)) and use it to
-- initialize a dummy tag value:
-- Descendant_Tag (String'Input (Strm), P_Type);
-- This value is used only to provide a controlling
-- argument for the eventual _Input call. Descendant_Tag is
-- called rather than Internal_Tag to ensure that we have a
-- tag for a type that is descended from the prefix type and
-- declared at the same accessibility level (the exception
-- Tag_Error will be raised otherwise). The level check is
-- required for Ada 2005 because tagged types can be
-- extended in nested scopes (AI-344).
-- Note: we used to generate an explicit declaration of a
-- constant Ada.Tags.Tag object, and use an occurrence of
-- this constant in Cntrl, but this caused a secondary stack
-- leak.
Expr :=
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (RTE (RE_Descendant_Tag), Loc),
Parameter_Associations => New_List (
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of (Standard_String, Loc),
Attribute_Name => Name_Input,
Expressions => New_List (
Relocate_Node (Duplicate_Subexpr (Strm)))),
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (P_Type, Loc),
Attribute_Name => Name_Tag)));
Set_Etype (Expr, RTE (RE_Tag));
-- Now we need to get the entity for the call, and construct
-- a function call node, where we preset a reference to Dnn
-- as the controlling argument (doing an unchecked convert
-- to the class-wide tagged type to make it look like a real
-- tagged object).
Fname := Find_Prim_Op (Rtyp, TSS_Stream_Input);
Cntrl := Unchecked_Convert_To (P_Type, Expr);
Set_Etype (Cntrl, P_Type);
Set_Parent (Cntrl, N);
end;
-- For tagged types, use the primitive Input function
elsif Is_Tagged_Type (U_Type) then
Fname := Find_Prim_Op (U_Type, TSS_Stream_Input);
-- All other record type cases, including protected records. The
-- latter only arise for expander generated code for handling
-- shared passive partition access.
else
pragma Assert
(Is_Record_Type (U_Type) or else Is_Protected_Type (U_Type));
-- Ada 2005 (AI-216): Program_Error is raised executing default
-- implementation of the Input attribute of an unchecked union
-- type if the type lacks default discriminant values.
if Is_Unchecked_Union (Base_Type (U_Type))
and then No (Discriminant_Constraint (U_Type))
then
Insert_Action (N,
Make_Raise_Program_Error (Loc,
Reason => PE_Unchecked_Union_Restriction));
return;
end if;
-- Build the type's Input function, passing the subtype rather
-- than its base type, because checks are needed in the case of
-- constrained discriminants (see Ada 2012 AI05-0192).
Build_Record_Or_Elementary_Input_Function
(Loc, U_Type, Decl, Fname);
Insert_Action (N, Decl);
if Nkind (Parent (N)) = N_Object_Declaration
and then Is_Record_Type (U_Type)
then
-- The stream function may contain calls to user-defined
-- Read procedures for individual components.
declare
Comp : Entity_Id;
Func : Entity_Id;
begin
Comp := First_Component (U_Type);
while Present (Comp) loop
Func :=
Find_Stream_Subprogram
(Etype (Comp), TSS_Stream_Read);
if Present (Func) then
Freeze_Stream_Subprogram (Func);
end if;
Next_Component (Comp);
end loop;
end;
end if;
end if;
end if;
-- If we fall through, Fname is the function to be called. The result
-- is obtained by calling the appropriate function, then converting
-- the result. The conversion does a subtype check.
Call :=
Make_Function_Call (Loc,
Name => New_Occurrence_Of (Fname, Loc),
Parameter_Associations => New_List (
Relocate_Node (Strm)));
Set_Controlling_Argument (Call, Cntrl);
Rewrite (N, Unchecked_Convert_To (P_Type, Call));
Analyze_And_Resolve (N, P_Type);
if Nkind (Parent (N)) = N_Object_Declaration then
Freeze_Stream_Subprogram (Fname);
end if;
end Input;
-------------------
-- Integer_Value --
-------------------
-- We transform
-- inttype'Fixed_Value (fixed-value)
-- into
-- inttype(integer-value))
-- we do all the required analysis of the conversion here, because we do
-- not want this to go through the fixed-point conversion circuits. Note
-- that the back end always treats fixed-point as equivalent to the
-- corresponding integer type anyway.
when Attribute_Integer_Value =>
Rewrite (N,
Make_Type_Conversion (Loc,
Subtype_Mark => New_Occurrence_Of (Entity (Pref), Loc),
Expression => Relocate_Node (First (Exprs))));
Set_Etype (N, Entity (Pref));
Set_Analyzed (N);
-- Note: it might appear that a properly analyzed unchecked
-- conversion would be just fine here, but that's not the case, since
-- the full range check performed by the following call is critical.
Apply_Type_Conversion_Checks (N);
-------------------
-- Invalid_Value --
-------------------
when Attribute_Invalid_Value =>
Rewrite (N, Get_Simple_Init_Val (Ptyp, N));
----------
-- Last --
----------
when Attribute_Last =>
-- If the prefix type is a constrained packed array type which
-- already has a Packed_Array_Impl_Type representation defined, then
-- replace this attribute with a direct reference to 'Last of the
-- appropriate index subtype (since otherwise the back end will try
-- to give us the value of 'Last for this implementation type).
if Is_Constrained_Packed_Array (Ptyp) then
Rewrite (N,
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Last,
Prefix => New_Occurrence_Of (Get_Index_Subtype (N), Loc)));
Analyze_And_Resolve (N, Typ);
-- For access type, apply access check as needed
elsif Is_Access_Type (Ptyp) then
Apply_Access_Check (N);
-- For scalar type, if low bound is a reference to an entity, just
-- replace with a direct reference. Note that we can only have a
-- reference to a constant entity at this stage, anything else would
-- have already been rewritten.
elsif Is_Scalar_Type (Ptyp) then
declare
Hi : constant Node_Id := Type_High_Bound (Ptyp);
begin
if Is_Entity_Name (Hi) then
Rewrite (N, New_Occurrence_Of (Entity (Hi), Loc));
end if;
end;
end if;
--------------
-- Last_Bit --
--------------
-- We compute this if a component clause was present, otherwise we leave
-- the computation up to the back end, since we don't know what layout
-- will be chosen.
when Attribute_Last_Bit => Last_Bit_Attr : declare
CE : constant Entity_Id := Entity (Selector_Name (Pref));
begin
-- In Ada 2005 (or later) if we have the non-default bit order, then
-- we return the original value as given in the component clause
-- (RM 2005 13.5.2(3/2)).
if Present (Component_Clause (CE))
and then Ada_Version >= Ada_2005
and then Reverse_Bit_Order (Scope (CE))
then
Rewrite (N,
Make_Integer_Literal (Loc,
Intval => Expr_Value (Last_Bit (Component_Clause (CE)))));
Analyze_And_Resolve (N, Typ);
-- Otherwise (Ada 83/95 or Ada 2005 or later with default bit order),
-- rewrite with normalized value if we know it statically.
elsif Known_Static_Component_Bit_Offset (CE)
and then Known_Static_Esize (CE)
then
Rewrite (N,
Make_Integer_Literal (Loc,
Intval => (Component_Bit_Offset (CE) mod System_Storage_Unit)
+ Esize (CE) - 1));
Analyze_And_Resolve (N, Typ);
-- Otherwise leave to back end, just apply universal integer checks
else
Apply_Universal_Integer_Attribute_Checks (N);
end if;
end Last_Bit_Attr;
------------------
-- Leading_Part --
------------------
-- Transforms 'Leading_Part into a call to the floating-point attribute
-- function Leading_Part in Fat_xxx (where xxx is the root type)
-- Note: strictly, we should generate special case code to deal with
-- absurdly large positive arguments (greater than Integer'Last), which
-- result in returning the first argument unchanged, but it hardly seems
-- worth the effort. We raise constraint error for absurdly negative
-- arguments which is fine.
when Attribute_Leading_Part =>
Expand_Fpt_Attribute_RI (N);
------------
-- Length --
------------
when Attribute_Length => Length : declare
Ityp : Entity_Id;
Xnum : Uint;
begin
-- Processing for packed array types
if Is_Array_Type (Ptyp) and then Is_Packed (Ptyp) then
Ityp := Get_Index_Subtype (N);
-- If the index type, Ityp, is an enumeration type with holes,
-- then we calculate X'Length explicitly using
-- Typ'Max
-- (0, Ityp'Pos (X'Last (N)) -
-- Ityp'Pos (X'First (N)) + 1);
-- Since the bounds in the template are the representation values
-- and the back end would get the wrong value.
if Is_Enumeration_Type (Ityp)
and then Present (Enum_Pos_To_Rep (Base_Type (Ityp)))
then
if No (Exprs) then
Xnum := Uint_1;
else
Xnum := Expr_Value (First (Expressions (N)));
end if;
Rewrite (N,
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Typ, Loc),
Attribute_Name => Name_Max,
Expressions => New_List
(Make_Integer_Literal (Loc, 0),
Make_Op_Add (Loc,
Left_Opnd =>
Make_Op_Subtract (Loc,
Left_Opnd =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Ityp, Loc),
Attribute_Name => Name_Pos,
Expressions => New_List (
Make_Attribute_Reference (Loc,
Prefix => Duplicate_Subexpr (Pref),
Attribute_Name => Name_Last,
Expressions => New_List (
Make_Integer_Literal (Loc, Xnum))))),
Right_Opnd =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Ityp, Loc),
Attribute_Name => Name_Pos,
Expressions => New_List (
Make_Attribute_Reference (Loc,
Prefix =>
Duplicate_Subexpr_No_Checks (Pref),
Attribute_Name => Name_First,
Expressions => New_List (
Make_Integer_Literal (Loc, Xnum)))))),
Right_Opnd => Make_Integer_Literal (Loc, 1)))));
Analyze_And_Resolve (N, Typ, Suppress => All_Checks);
return;
-- If the prefix type is a constrained packed array type which
-- already has a Packed_Array_Impl_Type representation defined,
-- then replace this attribute with a reference to 'Range_Length
-- of the appropriate index subtype (since otherwise the
-- back end will try to give us the value of 'Length for
-- this implementation type).s
elsif Is_Constrained (Ptyp) then
Rewrite (N,
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Range_Length,
Prefix => New_Occurrence_Of (Ityp, Loc)));
Analyze_And_Resolve (N, Typ);
end if;
-- Access type case
elsif Is_Access_Type (Ptyp) then
Apply_Access_Check (N);
-- If the designated type is a packed array type, then we convert
-- the reference to:
-- typ'Max (0, 1 +
-- xtyp'Pos (Pref'Last (Expr)) -
-- xtyp'Pos (Pref'First (Expr)));
-- This is a bit complex, but it is the easiest thing to do that
-- works in all cases including enum types with holes xtyp here
-- is the appropriate index type.
declare
Dtyp : constant Entity_Id := Designated_Type (Ptyp);
Xtyp : Entity_Id;
begin
if Is_Array_Type (Dtyp) and then Is_Packed (Dtyp) then
Xtyp := Get_Index_Subtype (N);
Rewrite (N,
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Typ, Loc),
Attribute_Name => Name_Max,
Expressions => New_List (
Make_Integer_Literal (Loc, 0),
Make_Op_Add (Loc,
Make_Integer_Literal (Loc, 1),
Make_Op_Subtract (Loc,
Left_Opnd =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Xtyp, Loc),
Attribute_Name => Name_Pos,
Expressions => New_List (
Make_Attribute_Reference (Loc,
Prefix => Duplicate_Subexpr (Pref),
Attribute_Name => Name_Last,
Expressions =>
New_Copy_List (Exprs)))),
Right_Opnd =>
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Xtyp, Loc),
Attribute_Name => Name_Pos,
Expressions => New_List (
Make_Attribute_Reference (Loc,
Prefix =>
Duplicate_Subexpr_No_Checks (Pref),
Attribute_Name => Name_First,
Expressions =>
New_Copy_List (Exprs)))))))));
Analyze_And_Resolve (N, Typ);
end if;
end;
-- Otherwise leave it to the back end
else
Apply_Universal_Integer_Attribute_Checks (N);
end if;
end Length;
-- Attribute Loop_Entry is replaced with a reference to a constant value
-- which captures the prefix at the entry point of the related loop. The
-- loop itself may be transformed into a conditional block.
when Attribute_Loop_Entry =>
Expand_Loop_Entry_Attribute (N);
-------------
-- Machine --
-------------
-- Transforms 'Machine into a call to the floating-point attribute
-- function Machine in Fat_xxx (where xxx is the root type).
-- Expansion is avoided for cases the back end can handle directly.
when Attribute_Machine =>
if not Is_Inline_Floating_Point_Attribute (N) then
Expand_Fpt_Attribute_R (N);
end if;
----------------------
-- Machine_Rounding --
----------------------
-- Transforms 'Machine_Rounding into a call to the floating-point
-- attribute function Machine_Rounding in Fat_xxx (where xxx is the root
-- type). Expansion is avoided for cases the back end can handle
-- directly.
when Attribute_Machine_Rounding =>
if not Is_Inline_Floating_Point_Attribute (N) then
Expand_Fpt_Attribute_R (N);
end if;
------------------
-- Machine_Size --
------------------
-- Machine_Size is equivalent to Object_Size, so transform it into
-- Object_Size and that way the back end never sees Machine_Size.
when Attribute_Machine_Size =>
Rewrite (N,
Make_Attribute_Reference (Loc,
Prefix => Prefix (N),
Attribute_Name => Name_Object_Size));
Analyze_And_Resolve (N, Typ);
--------------
-- Mantissa --
--------------
-- The only case that can get this far is the dynamic case of the old
-- Ada 83 Mantissa attribute for the fixed-point case. For this case,
-- we expand:
-- typ'Mantissa
-- into
-- ityp (System.Mantissa.Mantissa_Value
-- (Integer'Integer_Value (typ'First),
-- Integer'Integer_Value (typ'Last)));
when Attribute_Mantissa =>
Rewrite (N,
Convert_To (Typ,
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (RTE (RE_Mantissa_Value), Loc),
Parameter_Associations => New_List (
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Standard_Integer, Loc),
Attribute_Name => Name_Integer_Value,
Expressions => New_List (
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Ptyp, Loc),
Attribute_Name => Name_First))),
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Standard_Integer, Loc),
Attribute_Name => Name_Integer_Value,
Expressions => New_List (
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Ptyp, Loc),
Attribute_Name => Name_Last)))))));
Analyze_And_Resolve (N, Typ);
---------
-- Max --
---------
when Attribute_Max =>
Expand_Min_Max_Attribute (N);
----------------------------------
-- Max_Size_In_Storage_Elements --
----------------------------------
when Attribute_Max_Size_In_Storage_Elements => declare
Typ : constant Entity_Id := Etype (N);
Attr : Node_Id;
Conversion_Added : Boolean := False;
-- A flag which tracks whether the original attribute has been
-- wrapped inside a type conversion.
begin
-- If the prefix is X'Class, we transform it into a direct reference
-- to the class-wide type, because the back end must not see a 'Class
-- reference. See also 'Size.
if Is_Entity_Name (Pref)
and then Is_Class_Wide_Type (Entity (Pref))
then
Rewrite (Prefix (N), New_Occurrence_Of (Entity (Pref), Loc));
return;
end if;
Apply_Universal_Integer_Attribute_Checks (N);
-- The universal integer check may sometimes add a type conversion,
-- retrieve the original attribute reference from the expression.
Attr := N;
if Nkind (Attr) = N_Type_Conversion then
Attr := Expression (Attr);
Conversion_Added := True;
end if;
pragma Assert (Nkind (Attr) = N_Attribute_Reference);
-- Heap-allocated controlled objects contain two extra pointers which
-- are not part of the actual type. Transform the attribute reference
-- into a runtime expression to add the size of the hidden header.
if Needs_Finalization (Ptyp)
and then not Header_Size_Added (Attr)
then
Set_Header_Size_Added (Attr);
-- Generate:
-- P'Max_Size_In_Storage_Elements +
-- Universal_Integer
-- (Header_Size_With_Padding (Ptyp'Alignment))
Rewrite (Attr,
Make_Op_Add (Loc,
Left_Opnd => Relocate_Node (Attr),
Right_Opnd =>
Convert_To (Universal_Integer,
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of
(RTE (RE_Header_Size_With_Padding), Loc),
Parameter_Associations => New_List (
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of (Ptyp, Loc),
Attribute_Name => Name_Alignment))))));
-- Add a conversion to the target type
if not Conversion_Added then
Rewrite (Attr,
Make_Type_Conversion (Loc,
Subtype_Mark => New_Occurrence_Of (Typ, Loc),
Expression => Relocate_Node (Attr)));
end if;
Analyze (Attr);
return;
end if;
end;
--------------------
-- Mechanism_Code --
--------------------
when Attribute_Mechanism_Code =>
-- We must replace the prefix in the renamed case
if Is_Entity_Name (Pref)
and then Present (Alias (Entity (Pref)))
then
Set_Renamed_Subprogram (Pref, Alias (Entity (Pref)));
end if;
---------
-- Min --
---------
when Attribute_Min =>
Expand_Min_Max_Attribute (N);
---------
-- Mod --
---------
when Attribute_Mod => Mod_Case : declare
Arg : constant Node_Id := Relocate_Node (First (Exprs));
Hi : constant Node_Id := Type_High_Bound (Etype (Arg));
Modv : constant Uint := Modulus (Btyp);
begin
-- This is not so simple. The issue is what type to use for the
-- computation of the modular value.
-- The easy case is when the modulus value is within the bounds
-- of the signed integer type of the argument. In this case we can
-- just do the computation in that signed integer type, and then
-- do an ordinary conversion to the target type.
if Modv <= Expr_Value (Hi) then
Rewrite (N,
Convert_To (Btyp,
Make_Op_Mod (Loc,
Left_Opnd => Arg,
Right_Opnd => Make_Integer_Literal (Loc, Modv))));
-- Here we know that the modulus is larger than type'Last of the
-- integer type. There are two cases to consider:
-- a) The integer value is non-negative. In this case, it is
-- returned as the result (since it is less than the modulus).
-- b) The integer value is negative. In this case, we know that the
-- result is modulus + value, where the value might be as small as
-- -modulus. The trouble is what type do we use to do the subtract.
-- No type will do, since modulus can be as big as 2**64, and no
-- integer type accommodates this value. Let's do bit of algebra
-- modulus + value
-- = modulus - (-value)
-- = (modulus - 1) - (-value - 1)
-- Now modulus - 1 is certainly in range of the modular type.
-- -value is in the range 1 .. modulus, so -value -1 is in the
-- range 0 .. modulus-1 which is in range of the modular type.
-- Furthermore, (-value - 1) can be expressed as -(value + 1)
-- which we can compute using the integer base type.
-- Once this is done we analyze the if expression without range
-- checks, because we know everything is in range, and we want
-- to prevent spurious warnings on either branch.
else
Rewrite (N,
Make_If_Expression (Loc,
Expressions => New_List (
Make_Op_Ge (Loc,
Left_Opnd => Duplicate_Subexpr (Arg),
Right_Opnd => Make_Integer_Literal (Loc, 0)),
Convert_To (Btyp,
Duplicate_Subexpr_No_Checks (Arg)),
Make_Op_Subtract (Loc,
Left_Opnd =>
Make_Integer_Literal (Loc,
Intval => Modv - 1),
Right_Opnd =>
Convert_To (Btyp,
Make_Op_Minus (Loc,
Right_Opnd =>
Make_Op_Add (Loc,
Left_Opnd => Duplicate_Subexpr_No_Checks (Arg),
Right_Opnd =>
Make_Integer_Literal (Loc,
Intval => 1))))))));
end if;
Analyze_And_Resolve (N, Btyp, Suppress => All_Checks);
end Mod_Case;
-----------
-- Model --
-----------
-- Transforms 'Model into a call to the floating-point attribute
-- function Model in Fat_xxx (where xxx is the root type).
-- Expansion is avoided for cases the back end can handle directly.
when Attribute_Model =>
if not Is_Inline_Floating_Point_Attribute (N) then
Expand_Fpt_Attribute_R (N);
end if;
-----------------
-- Object_Size --
-----------------
-- The processing for Object_Size shares the processing for Size
---------
-- Old --
---------
when Attribute_Old => Old : declare
Typ : constant Entity_Id := Etype (N);
CW_Temp : Entity_Id;
CW_Typ : Entity_Id;
Ins_Nod : Node_Id;
Subp : Node_Id;
Temp : Entity_Id;
begin
-- Generating C code we don't need to expand this attribute when
-- we are analyzing the internally built nested postconditions
-- procedure since it will be expanded inline (and later it will
-- be removed by Expand_N_Subprogram_Body). It this expansion is
-- performed in such case then the compiler generates unreferenced
-- extra temporaries.
if Modify_Tree_For_C
and then Chars (Current_Scope) = Name_uPostconditions
then
return;
end if;
-- Climb the parent chain looking for subprogram _Postconditions
Subp := N;
while Present (Subp) loop
exit when Nkind (Subp) = N_Subprogram_Body
and then Chars (Defining_Entity (Subp)) = Name_uPostconditions;
-- If assertions are disabled, no need to create the declaration
-- that preserves the value. The postcondition pragma in which
-- 'Old appears will be checked or disabled according to the
-- current policy in effect.
if Nkind (Subp) = N_Pragma and then not Is_Checked (Subp) then
return;
end if;
Subp := Parent (Subp);
end loop;
-- 'Old can only appear in a postcondition, the generated body of
-- _Postconditions must be in the tree (or inlined if we are
-- generating C code).
pragma Assert
(Present (Subp)
or else (Modify_Tree_For_C and then In_Inlined_Body));
Temp := Make_Temporary (Loc, 'T', Pref);
-- Set the entity kind now in order to mark the temporary as a
-- handler of attribute 'Old's prefix.
Set_Ekind (Temp, E_Constant);
Set_Stores_Attribute_Old_Prefix (Temp);
-- Push the scope of the related subprogram where _Postcondition
-- resides as this ensures that the object will be analyzed in the
-- proper context.
if Present (Subp) then
Push_Scope (Scope (Defining_Entity (Subp)));
-- No need to push the scope when generating C code since the
-- _Postcondition procedure has been inlined.
else pragma Assert (Modify_Tree_For_C);
pragma Assert (In_Inlined_Body);
null;
end if;
-- Locate the insertion place of the internal temporary that saves
-- the 'Old value.
if Present (Subp) then
Ins_Nod := Subp;
-- Generating C, the postcondition procedure has been inlined and the
-- temporary is added before the first declaration of the enclosing
-- subprogram.
else pragma Assert (Modify_Tree_For_C);
Ins_Nod := N;
while Nkind (Ins_Nod) /= N_Subprogram_Body loop
Ins_Nod := Parent (Ins_Nod);
end loop;
Ins_Nod := First (Declarations (Ins_Nod));
end if;
-- Preserve the tag of the prefix by offering a specific view of the
-- class-wide version of the prefix.
if Is_Tagged_Type (Typ) then
-- Generate:
-- CW_Temp : constant Typ'Class := Typ'Class (Pref);
CW_Temp := Make_Temporary (Loc, 'T');
CW_Typ := Class_Wide_Type (Typ);
Insert_Before_And_Analyze (Ins_Nod,
Make_Object_Declaration (Loc,
Defining_Identifier => CW_Temp,
Constant_Present => True,
Object_Definition => New_Occurrence_Of (CW_Typ, Loc),
Expression =>
Convert_To (CW_Typ, Relocate_Node (Pref))));
-- Generate:
-- Temp : Typ renames Typ (CW_Temp);
Insert_Before_And_Analyze (Ins_Nod,
Make_Object_Renaming_Declaration (Loc,
Defining_Identifier => Temp,
Subtype_Mark => New_Occurrence_Of (Typ, Loc),
Name =>
Convert_To (Typ, New_Occurrence_Of (CW_Temp, Loc))));
-- Non-tagged case
else
-- Generate:
-- Temp : constant Typ := Pref;
Insert_Before_And_Analyze (Ins_Nod,
Make_Object_Declaration (Loc,
Defining_Identifier => Temp,
Constant_Present => True,
Object_Definition => New_Occurrence_Of (Typ, Loc),
Expression => Relocate_Node (Pref)));
end if;
if Present (Subp) then
Pop_Scope;
end if;
-- Ensure that the prefix of attribute 'Old is valid. The check must
-- be inserted after the expansion of the attribute has taken place
-- to reflect the new placement of the prefix.
if Validity_Checks_On and then Validity_Check_Operands then
Ensure_Valid (Pref);
end if;
Rewrite (N, New_Occurrence_Of (Temp, Loc));
end Old;
----------------------
-- Overlaps_Storage --
----------------------
when Attribute_Overlaps_Storage => Overlaps_Storage : declare
Loc : constant Source_Ptr := Sloc (N);
X : constant Node_Id := Prefix (N);
Y : constant Node_Id := First (Expressions (N));
-- The arguments
X_Addr, Y_Addr : Node_Id;
-- the expressions for their integer addresses
X_Size, Y_Size : Node_Id;
-- the expressions for their sizes
Cond : Node_Id;
begin
-- Attribute expands into:
-- if X'Address < Y'address then
-- (X'address + X'Size - 1) >= Y'address
-- else
-- (Y'address + Y'size - 1) >= X'Address
-- end if;
-- with the proper address operations. We convert addresses to
-- integer addresses to use predefined arithmetic. The size is
-- expressed in storage units. We add copies of X_Addr and Y_Addr
-- to prevent the appearance of the same node in two places in
-- the tree.
X_Addr :=
Unchecked_Convert_To (RTE (RE_Integer_Address),
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Address,
Prefix => New_Copy_Tree (X)));
Y_Addr :=
Unchecked_Convert_To (RTE (RE_Integer_Address),
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Address,
Prefix => New_Copy_Tree (Y)));
X_Size :=
Make_Op_Divide (Loc,
Left_Opnd =>
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Size,
Prefix => New_Copy_Tree (X)),
Right_Opnd =>
Make_Integer_Literal (Loc, System_Storage_Unit));
Y_Size :=
Make_Op_Divide (Loc,
Left_Opnd =>
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Size,
Prefix => New_Copy_Tree (Y)),
Right_Opnd =>
Make_Integer_Literal (Loc, System_Storage_Unit));
Cond :=
Make_Op_Le (Loc,
Left_Opnd => X_Addr,
Right_Opnd => Y_Addr);
Rewrite (N,
Make_If_Expression (Loc, New_List (
Cond,
Make_Op_Ge (Loc,
Left_Opnd =>
Make_Op_Add (Loc,
Left_Opnd => New_Copy_Tree (X_Addr),
Right_Opnd =>
Make_Op_Subtract (Loc,
Left_Opnd => X_Size,
Right_Opnd => Make_Integer_Literal (Loc, 1))),
Right_Opnd => Y_Addr),
Make_Op_Ge (Loc,
Left_Opnd =>
Make_Op_Add (Loc,
Left_Opnd => New_Copy_Tree (Y_Addr),
Right_Opnd =>
Make_Op_Subtract (Loc,
Left_Opnd => Y_Size,
Right_Opnd => Make_Integer_Literal (Loc, 1))),
Right_Opnd => X_Addr))));
Analyze_And_Resolve (N, Standard_Boolean);
end Overlaps_Storage;
------------
-- Output --
------------
when Attribute_Output => Output : declare
P_Type : constant Entity_Id := Entity (Pref);
U_Type : constant Entity_Id := Underlying_Type (P_Type);
Pname : Entity_Id;
Decl : Node_Id;
Prag : Node_Id;
Arg3 : Node_Id;
Wfunc : Node_Id;
begin
-- If no underlying type, we have an error that will be diagnosed
-- elsewhere, so here we just completely ignore the expansion.
if No (U_Type) then
return;
end if;
-- Stream operations can appear in user code even if the restriction
-- No_Streams is active (for example, when instantiating a predefined
-- container). In that case rewrite the attribute as a Raise to
-- prevent any run-time use.
if Restriction_Active (No_Streams) then
Rewrite (N,
Make_Raise_Program_Error (Sloc (N),
Reason => PE_Stream_Operation_Not_Allowed));
Set_Etype (N, Standard_Void_Type);
return;
end if;
-- If TSS for Output is present, just call it
Pname := Find_Stream_Subprogram (P_Type, TSS_Stream_Output);
if Present (Pname) then
null;
else
-- If there is a Stream_Convert pragma, use it, we rewrite
-- sourcetyp'Output (stream, Item)
-- as
-- strmtyp'Output (Stream, strmwrite (acttyp (Item)));
-- where strmwrite is the given Write function that converts an
-- argument of type sourcetyp or a type acctyp, from which it is
-- derived to type strmtyp. The conversion to acttyp is required
-- for the derived case.
Prag := Get_Stream_Convert_Pragma (P_Type);
if Present (Prag) then
Arg3 :=
Next (Next (First (Pragma_Argument_Associations (Prag))));
Wfunc := Entity (Expression (Arg3));
Rewrite (N,
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Etype (Wfunc), Loc),
Attribute_Name => Name_Output,
Expressions => New_List (
Relocate_Node (First (Exprs)),
Make_Function_Call (Loc,
Name => New_Occurrence_Of (Wfunc, Loc),
Parameter_Associations => New_List (
OK_Convert_To (Etype (First_Formal (Wfunc)),
Relocate_Node (Next (First (Exprs)))))))));
Analyze (N);
return;
-- For elementary types, we call the W_xxx routine directly. Note
-- that the effect of Write and Output is identical for the case
-- of an elementary type (there are no discriminants or bounds).
elsif Is_Elementary_Type (U_Type) then
-- A special case arises if we have a defined _Write routine,
-- since in this case we are required to call this routine.
declare
Typ : Entity_Id := P_Type;
begin
if Present (Full_View (Typ)) then
Typ := Full_View (Typ);
end if;
if Present (TSS (Base_Type (Typ), TSS_Stream_Write)) then
Build_Record_Or_Elementary_Output_Procedure
(Loc, Typ, Decl, Pname);
Insert_Action (N, Decl);
-- For normal cases, we call the W_xxx routine directly
else
Rewrite (N, Build_Elementary_Write_Call (N));
Analyze (N);
return;
end if;
end;
-- Array type case
elsif Is_Array_Type (U_Type) then
Build_Array_Output_Procedure (Loc, U_Type, Decl, Pname);
Compile_Stream_Body_In_Scope (N, Decl, U_Type, Check => False);
-- Class-wide case, first output external tag, then dispatch
-- to the appropriate primitive Output function (RM 13.13.2(31)).
elsif Is_Class_Wide_Type (P_Type) then
-- No need to do anything else compiling under restriction
-- No_Dispatching_Calls. During the semantic analysis we
-- already notified such violation.
if Restriction_Active (No_Dispatching_Calls) then
return;
end if;
Tag_Write : declare
Strm : constant Node_Id := First (Exprs);
Item : constant Node_Id := Next (Strm);
begin
-- Ada 2005 (AI-344): Check that the accessibility level
-- of the type of the output object is not deeper than
-- that of the attribute's prefix type.
-- if Get_Access_Level (Item'Tag)
-- /= Get_Access_Level (P_Type'Tag)
-- then
-- raise Tag_Error;
-- end if;
-- String'Output (Strm, External_Tag (Item'Tag));
-- We cannot figure out a practical way to implement this
-- accessibility check on virtual machines, so we omit it.
if Ada_Version >= Ada_2005
and then Tagged_Type_Expansion
then
Insert_Action (N,
Make_Implicit_If_Statement (N,
Condition =>
Make_Op_Ne (Loc,
Left_Opnd =>
Build_Get_Access_Level (Loc,
Make_Attribute_Reference (Loc,
Prefix =>
Relocate_Node (
Duplicate_Subexpr (Item,
Name_Req => True)),
Attribute_Name => Name_Tag)),
Right_Opnd =>
Make_Integer_Literal (Loc,
Type_Access_Level (P_Type))),
Then_Statements =>
New_List (Make_Raise_Statement (Loc,
New_Occurrence_Of (
RTE (RE_Tag_Error), Loc)))));
end if;
Insert_Action (N,
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Standard_String, Loc),
Attribute_Name => Name_Output,
Expressions => New_List (
Relocate_Node (Duplicate_Subexpr (Strm)),
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (RTE (RE_External_Tag), Loc),
Parameter_Associations => New_List (
Make_Attribute_Reference (Loc,
Prefix =>
Relocate_Node
(Duplicate_Subexpr (Item, Name_Req => True)),
Attribute_Name => Name_Tag))))));
end Tag_Write;
Pname := Find_Prim_Op (U_Type, TSS_Stream_Output);
-- Tagged type case, use the primitive Output function
elsif Is_Tagged_Type (U_Type) then
Pname := Find_Prim_Op (U_Type, TSS_Stream_Output);
-- All other record type cases, including protected records.
-- The latter only arise for expander generated code for
-- handling shared passive partition access.
else
pragma Assert
(Is_Record_Type (U_Type) or else Is_Protected_Type (U_Type));
-- Ada 2005 (AI-216): Program_Error is raised when executing
-- the default implementation of the Output attribute of an
-- unchecked union type if the type lacks default discriminant
-- values.
if Is_Unchecked_Union (Base_Type (U_Type))
and then No (Discriminant_Constraint (U_Type))
then
Insert_Action (N,
Make_Raise_Program_Error (Loc,
Reason => PE_Unchecked_Union_Restriction));
return;
end if;
Build_Record_Or_Elementary_Output_Procedure
(Loc, Base_Type (U_Type), Decl, Pname);
Insert_Action (N, Decl);
end if;
end if;
-- If we fall through, Pname is the name of the procedure to call
Rewrite_Stream_Proc_Call (Pname);
end Output;
---------
-- Pos --
---------
-- For enumeration types with a standard representation, Pos is
-- handled by the back end.
-- For enumeration types, with a non-standard representation we generate
-- a call to the _Rep_To_Pos function created when the type was frozen.
-- The call has the form
-- _rep_to_pos (expr, flag)
-- The parameter flag is True if range checks are enabled, causing
-- Program_Error to be raised if the expression has an invalid
-- representation, and False if range checks are suppressed.
-- For integer types, Pos is equivalent to a simple integer
-- conversion and we rewrite it as such
when Attribute_Pos => Pos : declare
Etyp : Entity_Id := Base_Type (Entity (Pref));
begin
-- Deal with zero/non-zero boolean values
if Is_Boolean_Type (Etyp) then
Adjust_Condition (First (Exprs));
Etyp := Standard_Boolean;
Set_Prefix (N, New_Occurrence_Of (Standard_Boolean, Loc));
end if;
-- Case of enumeration type
if Is_Enumeration_Type (Etyp) then
-- Non-standard enumeration type (generate call)
if Present (Enum_Pos_To_Rep (Etyp)) then
Append_To (Exprs, Rep_To_Pos_Flag (Etyp, Loc));
Rewrite (N,
Convert_To (Typ,
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (TSS (Etyp, TSS_Rep_To_Pos), Loc),
Parameter_Associations => Exprs)));
Analyze_And_Resolve (N, Typ);
-- Standard enumeration type (do universal integer check)
else
Apply_Universal_Integer_Attribute_Checks (N);
end if;
-- Deal with integer types (replace by conversion)
elsif Is_Integer_Type (Etyp) then
Rewrite (N, Convert_To (Typ, First (Exprs)));
Analyze_And_Resolve (N, Typ);
end if;
end Pos;
--------------
-- Position --
--------------
-- We compute this if a component clause was present, otherwise we leave
-- the computation up to the back end, since we don't know what layout
-- will be chosen.
when Attribute_Position => Position_Attr : declare
CE : constant Entity_Id := Entity (Selector_Name (Pref));
begin
if Present (Component_Clause (CE)) then
-- In Ada 2005 (or later) if we have the non-default bit order,
-- then we return the original value as given in the component
-- clause (RM 2005 13.5.2(2/2)).
if Ada_Version >= Ada_2005
and then Reverse_Bit_Order (Scope (CE))
then
Rewrite (N,
Make_Integer_Literal (Loc,
Intval => Expr_Value (Position (Component_Clause (CE)))));
-- Otherwise (Ada 83 or 95, or default bit order specified in
-- later Ada version), return the normalized value.
else
Rewrite (N,
Make_Integer_Literal (Loc,
Intval => Component_Bit_Offset (CE) / System_Storage_Unit));
end if;
Analyze_And_Resolve (N, Typ);
-- If back end is doing things, just apply universal integer checks
else
Apply_Universal_Integer_Attribute_Checks (N);
end if;
end Position_Attr;
----------
-- Pred --
----------
-- 1. Deal with enumeration types with holes.
-- 2. For floating-point, generate call to attribute function.
-- 3. For other cases, deal with constraint checking.
when Attribute_Pred => Pred : declare
Etyp : constant Entity_Id := Base_Type (Ptyp);
begin
-- For enumeration types with non-standard representations, we
-- expand typ'Pred (x) into
-- Pos_To_Rep (Rep_To_Pos (x) - 1)
-- If the representation is contiguous, we compute instead
-- Lit1 + Rep_to_Pos (x -1), to catch invalid representations.
-- The conversion function Enum_Pos_To_Rep is defined on the
-- base type, not the subtype, so we have to use the base type
-- explicitly for this and other enumeration attributes.
if Is_Enumeration_Type (Ptyp)
and then Present (Enum_Pos_To_Rep (Etyp))
then
if Has_Contiguous_Rep (Etyp) then
Rewrite (N,
Unchecked_Convert_To (Ptyp,
Make_Op_Add (Loc,
Left_Opnd =>
Make_Integer_Literal (Loc,
Enumeration_Rep (First_Literal (Ptyp))),
Right_Opnd =>
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of
(TSS (Etyp, TSS_Rep_To_Pos), Loc),
Parameter_Associations =>
New_List (
Unchecked_Convert_To (Ptyp,
Make_Op_Subtract (Loc,
Left_Opnd =>
Unchecked_Convert_To (Standard_Integer,
Relocate_Node (First (Exprs))),
Right_Opnd =>
Make_Integer_Literal (Loc, 1))),
Rep_To_Pos_Flag (Ptyp, Loc))))));
else
-- Add Boolean parameter True, to request program errror if
-- we have a bad representation on our hands. If checks are
-- suppressed, then add False instead
Append_To (Exprs, Rep_To_Pos_Flag (Ptyp, Loc));
Rewrite (N,
Make_Indexed_Component (Loc,
Prefix =>
New_Occurrence_Of
(Enum_Pos_To_Rep (Etyp), Loc),
Expressions => New_List (
Make_Op_Subtract (Loc,
Left_Opnd =>
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of
(TSS (Etyp, TSS_Rep_To_Pos), Loc),
Parameter_Associations => Exprs),
Right_Opnd => Make_Integer_Literal (Loc, 1)))));
end if;
Analyze_And_Resolve (N, Typ);
-- For floating-point, we transform 'Pred into a call to the Pred
-- floating-point attribute function in Fat_xxx (xxx is root type).
-- Note that this function takes care of the overflow case.
elsif Is_Floating_Point_Type (Ptyp) then
Expand_Fpt_Attribute_R (N);
Analyze_And_Resolve (N, Typ);
-- For modular types, nothing to do (no overflow, since wraps)
elsif Is_Modular_Integer_Type (Ptyp) then
null;
-- For other types, if argument is marked as needing a range check or
-- overflow checking is enabled, we must generate a check.
elsif not Overflow_Checks_Suppressed (Ptyp)
or else Do_Range_Check (First (Exprs))
then
Set_Do_Range_Check (First (Exprs), False);
Expand_Pred_Succ_Attribute (N);
end if;
end Pred;
--------------
-- Priority --
--------------
-- Ada 2005 (AI-327): Dynamic ceiling priorities
-- We rewrite X'Priority as the following run-time call:
-- Get_Ceiling (X._Object)
-- Note that although X'Priority is notionally an object, it is quite
-- deliberately not defined as an aliased object in the RM. This means
-- that it works fine to rewrite it as a call, without having to worry
-- about complications that would other arise from X'Priority'Access,
-- which is illegal, because of the lack of aliasing.
when Attribute_Priority => Priority : declare
Call : Node_Id;
Conctyp : Entity_Id;
New_Itype : Entity_Id;
Object_Parm : Node_Id;
Subprg : Entity_Id;
RT_Subprg_Name : Node_Id;
begin
-- Look for the enclosing concurrent type
Conctyp := Current_Scope;
while not Is_Concurrent_Type (Conctyp) loop
Conctyp := Scope (Conctyp);
end loop;
pragma Assert (Is_Protected_Type (Conctyp));
-- Generate the actual of the call
Subprg := Current_Scope;
while not Present (Protected_Body_Subprogram (Subprg)) loop
Subprg := Scope (Subprg);
end loop;
-- Use of 'Priority inside protected entries and barriers (in both
-- cases the type of the first formal of their expanded subprogram
-- is Address)
if Etype (First_Entity (Protected_Body_Subprogram (Subprg))) =
RTE (RE_Address)
then
-- In the expansion of protected entries the type of the first
-- formal of the Protected_Body_Subprogram is an Address. In order
-- to reference the _object component we generate:
-- type T is access p__ptTV;
-- freeze T []
New_Itype := Create_Itype (E_Access_Type, N);
Set_Etype (New_Itype, New_Itype);
Set_Directly_Designated_Type (New_Itype,
Corresponding_Record_Type (Conctyp));
Freeze_Itype (New_Itype, N);
-- Generate:
-- T!(O)._object'unchecked_access
Object_Parm :=
Make_Attribute_Reference (Loc,
Prefix =>
Make_Selected_Component (Loc,
Prefix =>
Unchecked_Convert_To (New_Itype,
New_Occurrence_Of
(First_Entity (Protected_Body_Subprogram (Subprg)),
Loc)),
Selector_Name => Make_Identifier (Loc, Name_uObject)),
Attribute_Name => Name_Unchecked_Access);
-- Use of 'Priority inside a protected subprogram
else
Object_Parm :=
Make_Attribute_Reference (Loc,
Prefix =>
Make_Selected_Component (Loc,
Prefix =>
New_Occurrence_Of
(First_Entity (Protected_Body_Subprogram (Subprg)),
Loc),
Selector_Name => Make_Identifier (Loc, Name_uObject)),
Attribute_Name => Name_Unchecked_Access);
end if;
-- Select the appropriate run-time subprogram
if Number_Entries (Conctyp) = 0 then
RT_Subprg_Name := New_Occurrence_Of (RTE (RE_Get_Ceiling), Loc);
else
RT_Subprg_Name := New_Occurrence_Of (RTE (RO_PE_Get_Ceiling), Loc);
end if;
Call :=
Make_Function_Call (Loc,
Name => RT_Subprg_Name,
Parameter_Associations => New_List (Object_Parm));
Rewrite (N, Call);
-- Avoid the generation of extra checks on the pointer to the
-- protected object.
Analyze_And_Resolve (N, Typ, Suppress => Access_Check);
end Priority;
------------------
-- Range_Length --
------------------
when Attribute_Range_Length =>
-- The only special processing required is for the case where
-- Range_Length is applied to an enumeration type with holes.
-- In this case we transform
-- X'Range_Length
-- to
-- X'Pos (X'Last) - X'Pos (X'First) + 1
-- So that the result reflects the proper Pos values instead
-- of the underlying representations.
if Is_Enumeration_Type (Ptyp)
and then Has_Non_Standard_Rep (Ptyp)
then
Rewrite (N,
Make_Op_Add (Loc,
Left_Opnd =>
Make_Op_Subtract (Loc,
Left_Opnd =>
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Pos,
Prefix => New_Occurrence_Of (Ptyp, Loc),
Expressions => New_List (
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Last,
Prefix =>
New_Occurrence_Of (Ptyp, Loc)))),
Right_Opnd =>
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Pos,
Prefix => New_Occurrence_Of (Ptyp, Loc),
Expressions => New_List (
Make_Attribute_Reference (Loc,
Attribute_Name => Name_First,
Prefix =>
New_Occurrence_Of (Ptyp, Loc))))),
Right_Opnd => Make_Integer_Literal (Loc, 1)));
Analyze_And_Resolve (N, Typ);
-- For all other cases, the attribute is handled by the back end, but
-- we need to deal with the case of the range check on a universal
-- integer.
else
Apply_Universal_Integer_Attribute_Checks (N);
end if;
----------
-- Read --
----------
when Attribute_Read => Read : declare
P_Type : constant Entity_Id := Entity (Pref);
B_Type : constant Entity_Id := Base_Type (P_Type);
U_Type : constant Entity_Id := Underlying_Type (P_Type);
Pname : Entity_Id;
Decl : Node_Id;
Prag : Node_Id;
Arg2 : Node_Id;
Rfunc : Node_Id;
Lhs : Node_Id;
Rhs : Node_Id;
begin
-- If no underlying type, we have an error that will be diagnosed
-- elsewhere, so here we just completely ignore the expansion.
if No (U_Type) then
return;
end if;
-- Stream operations can appear in user code even if the restriction
-- No_Streams is active (for example, when instantiating a predefined
-- container). In that case rewrite the attribute as a Raise to
-- prevent any run-time use.
if Restriction_Active (No_Streams) then
Rewrite (N,
Make_Raise_Program_Error (Sloc (N),
Reason => PE_Stream_Operation_Not_Allowed));
Set_Etype (N, B_Type);
return;
end if;
-- The simple case, if there is a TSS for Read, just call it
Pname := Find_Stream_Subprogram (P_Type, TSS_Stream_Read);
if Present (Pname) then
null;
else
-- If there is a Stream_Convert pragma, use it, we rewrite
-- sourcetyp'Read (stream, Item)
-- as
-- Item := sourcetyp (strmread (strmtyp'Input (Stream)));
-- where strmread is the given Read function that converts an
-- argument of type strmtyp to type sourcetyp or a type from which
-- it is derived. The conversion to sourcetyp is required in the
-- latter case.
-- A special case arises if Item is a type conversion in which
-- case, we have to expand to:
-- Itemx := typex (strmread (strmtyp'Input (Stream)));
-- where Itemx is the expression of the type conversion (i.e.
-- the actual object), and typex is the type of Itemx.
Prag := Get_Stream_Convert_Pragma (P_Type);
if Present (Prag) then
Arg2 := Next (First (Pragma_Argument_Associations (Prag)));
Rfunc := Entity (Expression (Arg2));
Lhs := Relocate_Node (Next (First (Exprs)));
Rhs :=
OK_Convert_To (B_Type,
Make_Function_Call (Loc,
Name => New_Occurrence_Of (Rfunc, Loc),
Parameter_Associations => New_List (
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of
(Etype (First_Formal (Rfunc)), Loc),
Attribute_Name => Name_Input,
Expressions => New_List (
Relocate_Node (First (Exprs)))))));
if Nkind (Lhs) = N_Type_Conversion then
Lhs := Expression (Lhs);
Rhs := Convert_To (Etype (Lhs), Rhs);
end if;
Rewrite (N,
Make_Assignment_Statement (Loc,
Name => Lhs,
Expression => Rhs));
Set_Assignment_OK (Lhs);
Analyze (N);
return;
-- For elementary types, we call the I_xxx routine using the first
-- parameter and then assign the result into the second parameter.
-- We set Assignment_OK to deal with the conversion case.
elsif Is_Elementary_Type (U_Type) then
declare
Lhs : Node_Id;
Rhs : Node_Id;
begin
Lhs := Relocate_Node (Next (First (Exprs)));
Rhs := Build_Elementary_Input_Call (N);
if Nkind (Lhs) = N_Type_Conversion then
Lhs := Expression (Lhs);
Rhs := Convert_To (Etype (Lhs), Rhs);
end if;
Set_Assignment_OK (Lhs);
Rewrite (N,
Make_Assignment_Statement (Loc,
Name => Lhs,
Expression => Rhs));
Analyze (N);
return;
end;
-- Array type case
elsif Is_Array_Type (U_Type) then
Build_Array_Read_Procedure (N, U_Type, Decl, Pname);
Compile_Stream_Body_In_Scope (N, Decl, U_Type, Check => False);
-- Tagged type case, use the primitive Read function. Note that
-- this will dispatch in the class-wide case which is what we want
elsif Is_Tagged_Type (U_Type) then
Pname := Find_Prim_Op (U_Type, TSS_Stream_Read);
-- All other record type cases, including protected records. The
-- latter only arise for expander generated code for handling
-- shared passive partition access.
else
pragma Assert
(Is_Record_Type (U_Type) or else Is_Protected_Type (U_Type));
-- Ada 2005 (AI-216): Program_Error is raised when executing
-- the default implementation of the Read attribute of an
-- Unchecked_Union type.
if Is_Unchecked_Union (Base_Type (U_Type)) then
Insert_Action (N,
Make_Raise_Program_Error (Loc,
Reason => PE_Unchecked_Union_Restriction));
end if;
if Has_Discriminants (U_Type)
and then Present
(Discriminant_Default_Value (First_Discriminant (U_Type)))
then
Build_Mutable_Record_Read_Procedure
(Loc, Full_Base (U_Type), Decl, Pname);
else
Build_Record_Read_Procedure
(Loc, Full_Base (U_Type), Decl, Pname);
end if;
-- Suppress checks, uninitialized or otherwise invalid
-- data does not cause constraint errors to be raised for
-- a complete record read.
Insert_Action (N, Decl, All_Checks);
end if;
end if;
Rewrite_Stream_Proc_Call (Pname);
end Read;
---------
-- Ref --
---------
-- Ref is identical to To_Address, see To_Address for processing
---------------
-- Remainder --
---------------
-- Transforms 'Remainder into a call to the floating-point attribute
-- function Remainder in Fat_xxx (where xxx is the root type)
when Attribute_Remainder =>
Expand_Fpt_Attribute_RR (N);
------------
-- Result --
------------
-- Transform 'Result into reference to _Result formal. At the point
-- where a legal 'Result attribute is expanded, we know that we are in
-- the context of a _Postcondition function with a _Result parameter.
when Attribute_Result =>
Rewrite (N, Make_Identifier (Loc, Chars => Name_uResult));
Analyze_And_Resolve (N, Typ);
-----------
-- Round --
-----------
-- The handling of the Round attribute is quite delicate. The processing
-- in Sem_Attr introduced a conversion to universal real, reflecting the
-- semantics of Round, but we do not want anything to do with universal
-- real at runtime, since this corresponds to using floating-point
-- arithmetic.
-- What we have now is that the Etype of the Round attribute correctly
-- indicates the final result type. The operand of the Round is the
-- conversion to universal real, described above, and the operand of
-- this conversion is the actual operand of Round, which may be the
-- special case of a fixed point multiplication or division (Etype =
-- universal fixed)
-- The exapander will expand first the operand of the conversion, then
-- the conversion, and finally the round attribute itself, since we
-- always work inside out. But we cannot simply process naively in this
-- order. In the semantic world where universal fixed and real really
-- exist and have infinite precision, there is no problem, but in the
-- implementation world, where universal real is a floating-point type,
-- we would get the wrong result.
-- So the approach is as follows. First, when expanding a multiply or
-- divide whose type is universal fixed, we do nothing at all, instead
-- deferring the operation till later.
-- The actual processing is done in Expand_N_Type_Conversion which
-- handles the special case of Round by looking at its parent to see if
-- it is a Round attribute, and if it is, handling the conversion (or
-- its fixed multiply/divide child) in an appropriate manner.
-- This means that by the time we get to expanding the Round attribute
-- itself, the Round is nothing more than a type conversion (and will
-- often be a null type conversion), so we just replace it with the
-- appropriate conversion operation.
when Attribute_Round =>
Rewrite (N,
Convert_To (Etype (N), Relocate_Node (First (Exprs))));
Analyze_And_Resolve (N);
--------------
-- Rounding --
--------------
-- Transforms 'Rounding into a call to the floating-point attribute
-- function Rounding in Fat_xxx (where xxx is the root type)
-- Expansion is avoided for cases the back end can handle directly.
when Attribute_Rounding =>
if not Is_Inline_Floating_Point_Attribute (N) then
Expand_Fpt_Attribute_R (N);
end if;
-------------
-- Scaling --
-------------
-- Transforms 'Scaling into a call to the floating-point attribute
-- function Scaling in Fat_xxx (where xxx is the root type)
when Attribute_Scaling =>
Expand_Fpt_Attribute_RI (N);
-------------------------
-- Simple_Storage_Pool --
-------------------------
when Attribute_Simple_Storage_Pool =>
Rewrite (N,
Make_Type_Conversion (Loc,
Subtype_Mark => New_Occurrence_Of (Etype (N), Loc),
Expression => New_Occurrence_Of (Entity (N), Loc)));
Analyze_And_Resolve (N, Typ);
----------
-- Size --
----------
when Attribute_Object_Size
| Attribute_Size
| Attribute_Value_Size
| Attribute_VADS_Size
=>
Size : declare
Siz : Uint;
New_Node : Node_Id;
begin
-- Processing for VADS_Size case. Note that this processing
-- removes all traces of VADS_Size from the tree, and completes
-- all required processing for VADS_Size by translating the
-- attribute reference to an appropriate Size or Object_Size
-- reference.
if Id = Attribute_VADS_Size
or else (Use_VADS_Size and then Id = Attribute_Size)
then
-- If the size is specified, then we simply use the specified
-- size. This applies to both types and objects. The size of an
-- object can be specified in the following ways:
-- An explicit size object is given for an object
-- A component size is specified for an indexed component
-- A component clause is specified for a selected component
-- The object is a component of a packed composite object
-- If the size is specified, then VADS_Size of an object
if (Is_Entity_Name (Pref)
and then Present (Size_Clause (Entity (Pref))))
or else
(Nkind (Pref) = N_Component_Clause
and then (Present (Component_Clause
(Entity (Selector_Name (Pref))))
or else Is_Packed (Etype (Prefix (Pref)))))
or else
(Nkind (Pref) = N_Indexed_Component
and then (Component_Size (Etype (Prefix (Pref))) /= 0
or else Is_Packed (Etype (Prefix (Pref)))))
then
Set_Attribute_Name (N, Name_Size);
-- Otherwise if we have an object rather than a type, then
-- the VADS_Size attribute applies to the type of the object,
-- rather than the object itself. This is one of the respects
-- in which VADS_Size differs from Size.
else
if (not Is_Entity_Name (Pref)
or else not Is_Type (Entity (Pref)))
and then (Is_Scalar_Type (Ptyp)
or else Is_Constrained (Ptyp))
then
Rewrite (Pref, New_Occurrence_Of (Ptyp, Loc));
end if;
-- For a scalar type for which no size was explicitly given,
-- VADS_Size means Object_Size. This is the other respect in
-- which VADS_Size differs from Size.
if Is_Scalar_Type (Ptyp)
and then No (Size_Clause (Ptyp))
then
Set_Attribute_Name (N, Name_Object_Size);
-- In all other cases, Size and VADS_Size are the sane
else
Set_Attribute_Name (N, Name_Size);
end if;
end if;
end if;
-- If the prefix is X'Class, transform it into a direct reference
-- to the class-wide type, because the back end must not see a
-- 'Class reference.
if Is_Entity_Name (Pref)
and then Is_Class_Wide_Type (Entity (Pref))
then
Rewrite (Prefix (N), New_Occurrence_Of (Entity (Pref), Loc));
return;
-- For X'Size applied to an object of a class-wide type, transform
-- X'Size into a call to the primitive operation _Size applied to
-- X.
elsif Is_Class_Wide_Type (Ptyp) then
-- No need to do anything else compiling under restriction
-- No_Dispatching_Calls. During the semantic analysis we
-- already noted this restriction violation.
if Restriction_Active (No_Dispatching_Calls) then
return;
end if;
New_Node :=
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (Find_Prim_Op (Ptyp, Name_uSize), Loc),
Parameter_Associations => New_List (Pref));
if Typ /= Standard_Long_Long_Integer then
-- The context is a specific integer type with which the
-- original attribute was compatible. The function has a
-- specific type as well, so to preserve the compatibility
-- we must convert explicitly.
New_Node := Convert_To (Typ, New_Node);
end if;
Rewrite (N, New_Node);
Analyze_And_Resolve (N, Typ);
return;
-- Case of known RM_Size of a type
elsif (Id = Attribute_Size or else Id = Attribute_Value_Size)
and then Is_Entity_Name (Pref)
and then Is_Type (Entity (Pref))
and then Known_Static_RM_Size (Entity (Pref))
then
Siz := RM_Size (Entity (Pref));
-- Case of known Esize of a type
elsif Id = Attribute_Object_Size
and then Is_Entity_Name (Pref)
and then Is_Type (Entity (Pref))
and then Known_Static_Esize (Entity (Pref))
then
Siz := Esize (Entity (Pref));
-- Case of known size of object
elsif Id = Attribute_Size
and then Is_Entity_Name (Pref)
and then Is_Object (Entity (Pref))
and then Known_Esize (Entity (Pref))
and then Known_Static_Esize (Entity (Pref))
then
Siz := Esize (Entity (Pref));
-- For an array component, we can do Size in the front end if the
-- component_size of the array is set.
elsif Nkind (Pref) = N_Indexed_Component then
Siz := Component_Size (Etype (Prefix (Pref)));
-- For a record component, we can do Size in the front end if
-- there is a component clause, or if the record is packed and the
-- component's size is known at compile time.
elsif Nkind (Pref) = N_Selected_Component then
declare
Rec : constant Entity_Id := Etype (Prefix (Pref));
Comp : constant Entity_Id := Entity (Selector_Name (Pref));
begin
if Present (Component_Clause (Comp)) then
Siz := Esize (Comp);
elsif Is_Packed (Rec) then
Siz := RM_Size (Ptyp);
else
Apply_Universal_Integer_Attribute_Checks (N);
return;
end if;
end;
-- All other cases are handled by the back end
else
Apply_Universal_Integer_Attribute_Checks (N);
-- If Size is applied to a formal parameter that is of a packed
-- array subtype, then apply Size to the actual subtype.
if Is_Entity_Name (Pref)
and then Is_Formal (Entity (Pref))
and then Is_Array_Type (Ptyp)
and then Is_Packed (Ptyp)
then
Rewrite (N,
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of (Get_Actual_Subtype (Pref), Loc),
Attribute_Name => Name_Size));
Analyze_And_Resolve (N, Typ);
end if;
-- If Size applies to a dereference of an access to
-- unconstrained packed array, the back end needs to see its
-- unconstrained nominal type, but also a hint to the actual
-- constrained type.
if Nkind (Pref) = N_Explicit_Dereference
and then Is_Array_Type (Ptyp)
and then not Is_Constrained (Ptyp)
and then Is_Packed (Ptyp)
then
Set_Actual_Designated_Subtype (Pref,
Get_Actual_Subtype (Pref));
end if;
return;
end if;
-- Common processing for record and array component case
if Siz /= No_Uint and then Siz /= 0 then
declare
CS : constant Boolean := Comes_From_Source (N);
begin
Rewrite (N, Make_Integer_Literal (Loc, Siz));
-- This integer literal is not a static expression. We do
-- not call Analyze_And_Resolve here, because this would
-- activate the circuit for deciding that a static value
-- was out of range, and we don't want that.
-- So just manually set the type, mark the expression as
-- non-static, and then ensure that the result is checked
-- properly if the attribute comes from source (if it was
-- internally generated, we never need a constraint check).
Set_Etype (N, Typ);
Set_Is_Static_Expression (N, False);
if CS then
Apply_Constraint_Check (N, Typ);
end if;
end;
end if;
end Size;
------------------
-- Storage_Pool --
------------------
when Attribute_Storage_Pool =>
Rewrite (N,
Make_Type_Conversion (Loc,
Subtype_Mark => New_Occurrence_Of (Etype (N), Loc),
Expression => New_Occurrence_Of (Entity (N), Loc)));
Analyze_And_Resolve (N, Typ);
------------------
-- Storage_Size --
------------------
when Attribute_Storage_Size => Storage_Size : declare
Alloc_Op : Entity_Id := Empty;
begin
-- Access type case, always go to the root type
-- The case of access types results in a value of zero for the case
-- where no storage size attribute clause has been given. If a
-- storage size has been given, then the attribute is converted
-- to a reference to the variable used to hold this value.
if Is_Access_Type (Ptyp) then
if Present (Storage_Size_Variable (Root_Type (Ptyp))) then
Rewrite (N,
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Typ, Loc),
Attribute_Name => Name_Max,
Expressions => New_List (
Make_Integer_Literal (Loc, 0),
Convert_To (Typ,
New_Occurrence_Of
(Storage_Size_Variable (Root_Type (Ptyp)), Loc)))));
elsif Present (Associated_Storage_Pool (Root_Type (Ptyp))) then
-- If the access type is associated with a simple storage pool
-- object, then attempt to locate the optional Storage_Size
-- function of the simple storage pool type. If not found,
-- then the result will default to zero.
if Present (Get_Rep_Pragma (Root_Type (Ptyp),
Name_Simple_Storage_Pool_Type))
then
declare
Pool_Type : constant Entity_Id :=
Base_Type (Etype (Entity (N)));
begin
Alloc_Op := Get_Name_Entity_Id (Name_Storage_Size);
while Present (Alloc_Op) loop
if Scope (Alloc_Op) = Scope (Pool_Type)
and then Present (First_Formal (Alloc_Op))
and then Etype (First_Formal (Alloc_Op)) = Pool_Type
then
exit;
end if;
Alloc_Op := Homonym (Alloc_Op);
end loop;
end;
-- In the normal Storage_Pool case, retrieve the primitive
-- function associated with the pool type.
else
Alloc_Op :=
Find_Prim_Op
(Etype (Associated_Storage_Pool (Root_Type (Ptyp))),
Attribute_Name (N));
end if;
-- If Storage_Size wasn't found (can only occur in the simple
-- storage pool case), then simply use zero for the result.
if not Present (Alloc_Op) then
Rewrite (N, Make_Integer_Literal (Loc, 0));
-- Otherwise, rewrite the allocator as a call to pool type's
-- Storage_Size function.
else
Rewrite (N,
OK_Convert_To (Typ,
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (Alloc_Op, Loc),
Parameter_Associations => New_List (
New_Occurrence_Of
(Associated_Storage_Pool
(Root_Type (Ptyp)), Loc)))));
end if;
else
Rewrite (N, Make_Integer_Literal (Loc, 0));
end if;
Analyze_And_Resolve (N, Typ);
-- For tasks, we retrieve the size directly from the TCB. The
-- size may depend on a discriminant of the type, and therefore
-- can be a per-object expression, so type-level information is
-- not sufficient in general. There are four cases to consider:
-- a) If the attribute appears within a task body, the designated
-- TCB is obtained by a call to Self.
-- b) If the prefix of the attribute is the name of a task object,
-- the designated TCB is the one stored in the corresponding record.
-- c) If the prefix is a task type, the size is obtained from the
-- size variable created for each task type
-- d) If no Storage_Size was specified for the type, there is no
-- size variable, and the value is a system-specific default.
else
if In_Open_Scopes (Ptyp) then
-- Storage_Size (Self)
Rewrite (N,
Convert_To (Typ,
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (RTE (RE_Storage_Size), Loc),
Parameter_Associations =>
New_List (
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (RTE (RE_Self), Loc))))));
elsif not Is_Entity_Name (Pref)
or else not Is_Type (Entity (Pref))
then
-- Storage_Size (Rec (Obj).Size)
Rewrite (N,
Convert_To (Typ,
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (RTE (RE_Storage_Size), Loc),
Parameter_Associations =>
New_List (
Make_Selected_Component (Loc,
Prefix =>
Unchecked_Convert_To (
Corresponding_Record_Type (Ptyp),
New_Copy_Tree (Pref)),
Selector_Name =>
Make_Identifier (Loc, Name_uTask_Id))))));
elsif Present (Storage_Size_Variable (Ptyp)) then
-- Static Storage_Size pragma given for type: retrieve value
-- from its allocated storage variable.
Rewrite (N,
Convert_To (Typ,
Make_Function_Call (Loc,
Name => New_Occurrence_Of (
RTE (RE_Adjust_Storage_Size), Loc),
Parameter_Associations =>
New_List (
New_Occurrence_Of (
Storage_Size_Variable (Ptyp), Loc)))));
else
-- Get system default
Rewrite (N,
Convert_To (Typ,
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (
RTE (RE_Default_Stack_Size), Loc))));
end if;
Analyze_And_Resolve (N, Typ);
end if;
end Storage_Size;
-----------------
-- Stream_Size --
-----------------
when Attribute_Stream_Size =>
Rewrite (N,
Make_Integer_Literal (Loc, Intval => Get_Stream_Size (Ptyp)));
Analyze_And_Resolve (N, Typ);
----------
-- Succ --
----------
-- 1. Deal with enumeration types with holes.
-- 2. For floating-point, generate call to attribute function.
-- 3. For other cases, deal with constraint checking.
when Attribute_Succ => Succ : declare
Etyp : constant Entity_Id := Base_Type (Ptyp);
begin
-- For enumeration types with non-standard representations, we
-- expand typ'Succ (x) into
-- Pos_To_Rep (Rep_To_Pos (x) + 1)
-- If the representation is contiguous, we compute instead
-- Lit1 + Rep_to_Pos (x+1), to catch invalid representations.
if Is_Enumeration_Type (Ptyp)
and then Present (Enum_Pos_To_Rep (Etyp))
then
if Has_Contiguous_Rep (Etyp) then
Rewrite (N,
Unchecked_Convert_To (Ptyp,
Make_Op_Add (Loc,
Left_Opnd =>
Make_Integer_Literal (Loc,
Enumeration_Rep (First_Literal (Ptyp))),
Right_Opnd =>
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of
(TSS (Etyp, TSS_Rep_To_Pos), Loc),
Parameter_Associations =>
New_List (
Unchecked_Convert_To (Ptyp,
Make_Op_Add (Loc,
Left_Opnd =>
Unchecked_Convert_To (Standard_Integer,
Relocate_Node (First (Exprs))),
Right_Opnd =>
Make_Integer_Literal (Loc, 1))),
Rep_To_Pos_Flag (Ptyp, Loc))))));
else
-- Add Boolean parameter True, to request program errror if
-- we have a bad representation on our hands. Add False if
-- checks are suppressed.
Append_To (Exprs, Rep_To_Pos_Flag (Ptyp, Loc));
Rewrite (N,
Make_Indexed_Component (Loc,
Prefix =>
New_Occurrence_Of
(Enum_Pos_To_Rep (Etyp), Loc),
Expressions => New_List (
Make_Op_Add (Loc,
Left_Opnd =>
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of
(TSS (Etyp, TSS_Rep_To_Pos), Loc),
Parameter_Associations => Exprs),
Right_Opnd => Make_Integer_Literal (Loc, 1)))));
end if;
Analyze_And_Resolve (N, Typ);
-- For floating-point, we transform 'Succ into a call to the Succ
-- floating-point attribute function in Fat_xxx (xxx is root type)
elsif Is_Floating_Point_Type (Ptyp) then
Expand_Fpt_Attribute_R (N);
Analyze_And_Resolve (N, Typ);
-- For modular types, nothing to do (no overflow, since wraps)
elsif Is_Modular_Integer_Type (Ptyp) then
null;
-- For other types, if argument is marked as needing a range check or
-- overflow checking is enabled, we must generate a check.
elsif not Overflow_Checks_Suppressed (Ptyp)
or else Do_Range_Check (First (Exprs))
then
Set_Do_Range_Check (First (Exprs), False);
Expand_Pred_Succ_Attribute (N);
end if;
end Succ;
---------
-- Tag --
---------
-- Transforms X'Tag into a direct reference to the tag of X
when Attribute_Tag => Tag : declare
Ttyp : Entity_Id;
Prefix_Is_Type : Boolean;
begin
if Is_Entity_Name (Pref) and then Is_Type (Entity (Pref)) then
Ttyp := Entity (Pref);
Prefix_Is_Type := True;
else
Ttyp := Ptyp;
Prefix_Is_Type := False;
end if;
if Is_Class_Wide_Type (Ttyp) then
Ttyp := Root_Type (Ttyp);
end if;
Ttyp := Underlying_Type (Ttyp);
-- Ada 2005: The type may be a synchronized tagged type, in which
-- case the tag information is stored in the corresponding record.
if Is_Concurrent_Type (Ttyp) then
Ttyp := Corresponding_Record_Type (Ttyp);
end if;
if Prefix_Is_Type then
-- For VMs we leave the type attribute unexpanded because
-- there's not a dispatching table to reference.
if Tagged_Type_Expansion then
Rewrite (N,
Unchecked_Convert_To (RTE (RE_Tag),
New_Occurrence_Of
(Node (First_Elmt (Access_Disp_Table (Ttyp))), Loc)));
Analyze_And_Resolve (N, RTE (RE_Tag));
end if;
-- Ada 2005 (AI-251): The use of 'Tag in the sources always
-- references the primary tag of the actual object. If 'Tag is
-- applied to class-wide interface objects we generate code that
-- displaces "this" to reference the base of the object.
elsif Comes_From_Source (N)
and then Is_Class_Wide_Type (Etype (Prefix (N)))
and then Is_Interface (Etype (Prefix (N)))
then
-- Generate:
-- (To_Tag_Ptr (Prefix'Address)).all
-- Note that Prefix'Address is recursively expanded into a call
-- to Base_Address (Obj.Tag)
-- Not needed for VM targets, since all handled by the VM
if Tagged_Type_Expansion then
Rewrite (N,
Make_Explicit_Dereference (Loc,
Unchecked_Convert_To (RTE (RE_Tag_Ptr),
Make_Attribute_Reference (Loc,
Prefix => Relocate_Node (Pref),
Attribute_Name => Name_Address))));
Analyze_And_Resolve (N, RTE (RE_Tag));
end if;
else
Rewrite (N,
Make_Selected_Component (Loc,
Prefix => Relocate_Node (Pref),
Selector_Name =>
New_Occurrence_Of (First_Tag_Component (Ttyp), Loc)));
Analyze_And_Resolve (N, RTE (RE_Tag));
end if;
end Tag;
----------------
-- Terminated --
----------------
-- Transforms 'Terminated attribute into a call to Terminated function
when Attribute_Terminated => Terminated : begin
-- The prefix of Terminated is of a task interface class-wide type.
-- Generate:
-- terminated (Task_Id (Pref._disp_get_task_id));
if Ada_Version >= Ada_2005
and then Ekind (Ptyp) = E_Class_Wide_Type
and then Is_Interface (Ptyp)
and then Is_Task_Interface (Ptyp)
then
Rewrite (N,
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (RTE (RE_Terminated), Loc),
Parameter_Associations => New_List (
Make_Unchecked_Type_Conversion (Loc,
Subtype_Mark =>
New_Occurrence_Of (RTE (RO_ST_Task_Id), Loc),
Expression =>
Make_Selected_Component (Loc,
Prefix =>
New_Copy_Tree (Pref),
Selector_Name =>
Make_Identifier (Loc, Name_uDisp_Get_Task_Id))))));
elsif Restricted_Profile then
Rewrite (N,
Build_Call_With_Task (Pref, RTE (RE_Restricted_Terminated)));
else
Rewrite (N,
Build_Call_With_Task (Pref, RTE (RE_Terminated)));
end if;
Analyze_And_Resolve (N, Standard_Boolean);
end Terminated;
----------------
-- To_Address --
----------------
-- Transforms System'To_Address (X) and System.Address'Ref (X) into
-- unchecked conversion from (integral) type of X to type address.
when Attribute_Ref
| Attribute_To_Address
=>
Rewrite (N,
Unchecked_Convert_To (RTE (RE_Address),
Relocate_Node (First (Exprs))));
Analyze_And_Resolve (N, RTE (RE_Address));
------------
-- To_Any --
------------
when Attribute_To_Any => To_Any : declare
P_Type : constant Entity_Id := Etype (Pref);
Decls : constant List_Id := New_List;
begin
Rewrite (N,
Build_To_Any_Call
(Loc,
Convert_To (P_Type,
Relocate_Node (First (Exprs))), Decls));
Insert_Actions (N, Decls);
Analyze_And_Resolve (N, RTE (RE_Any));
end To_Any;
----------------
-- Truncation --
----------------
-- Transforms 'Truncation into a call to the floating-point attribute
-- function Truncation in Fat_xxx (where xxx is the root type).
-- Expansion is avoided for cases the back end can handle directly.
when Attribute_Truncation =>
if not Is_Inline_Floating_Point_Attribute (N) then
Expand_Fpt_Attribute_R (N);
end if;
--------------
-- TypeCode --
--------------
when Attribute_TypeCode => TypeCode : declare
P_Type : constant Entity_Id := Etype (Pref);
Decls : constant List_Id := New_List;
begin
Rewrite (N, Build_TypeCode_Call (Loc, P_Type, Decls));
Insert_Actions (N, Decls);
Analyze_And_Resolve (N, RTE (RE_TypeCode));
end TypeCode;
-----------------------
-- Unbiased_Rounding --
-----------------------
-- Transforms 'Unbiased_Rounding into a call to the floating-point
-- attribute function Unbiased_Rounding in Fat_xxx (where xxx is the
-- root type). Expansion is avoided for cases the back end can handle
-- directly.
when Attribute_Unbiased_Rounding =>
if not Is_Inline_Floating_Point_Attribute (N) then
Expand_Fpt_Attribute_R (N);
end if;
------------
-- Update --
------------
when Attribute_Update =>
Expand_Update_Attribute (N);
---------------
-- VADS_Size --
---------------
-- The processing for VADS_Size is shared with Size
---------
-- Val --
---------
-- For enumeration types with a standard representation, and for all
-- other types, Val is handled by the back end. For enumeration types
-- with a non-standard representation we use the _Pos_To_Rep array that
-- was created when the type was frozen.
when Attribute_Val => Val : declare
Etyp : constant Entity_Id := Base_Type (Entity (Pref));
begin
if Is_Enumeration_Type (Etyp)
and then Present (Enum_Pos_To_Rep (Etyp))
then
if Has_Contiguous_Rep (Etyp) then
declare
Rep_Node : constant Node_Id :=
Unchecked_Convert_To (Etyp,
Make_Op_Add (Loc,
Left_Opnd =>
Make_Integer_Literal (Loc,
Enumeration_Rep (First_Literal (Etyp))),
Right_Opnd =>
(Convert_To (Standard_Integer,
Relocate_Node (First (Exprs))))));
begin
Rewrite (N,
Unchecked_Convert_To (Etyp,
Make_Op_Add (Loc,
Left_Opnd =>
Make_Integer_Literal (Loc,
Enumeration_Rep (First_Literal (Etyp))),
Right_Opnd =>
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of
(TSS (Etyp, TSS_Rep_To_Pos), Loc),
Parameter_Associations => New_List (
Rep_Node,
Rep_To_Pos_Flag (Etyp, Loc))))));
end;
else
Rewrite (N,
Make_Indexed_Component (Loc,
Prefix => New_Occurrence_Of (Enum_Pos_To_Rep (Etyp), Loc),
Expressions => New_List (
Convert_To (Standard_Integer,
Relocate_Node (First (Exprs))))));
end if;
Analyze_And_Resolve (N, Typ);
-- If the argument is marked as requiring a range check then generate
-- it here.
elsif Do_Range_Check (First (Exprs)) then
Generate_Range_Check (First (Exprs), Etyp, CE_Range_Check_Failed);
end if;
end Val;
-----------
-- Valid --
-----------
-- The code for valid is dependent on the particular types involved.
-- See separate sections below for the generated code in each case.
when Attribute_Valid => Valid : declare
Btyp : Entity_Id := Base_Type (Ptyp);
Tst : Node_Id;
Save_Validity_Checks_On : constant Boolean := Validity_Checks_On;
-- Save the validity checking mode. We always turn off validity
-- checking during process of 'Valid since this is one place
-- where we do not want the implicit validity checks to intefere
-- with the explicit validity check that the programmer is doing.
function Make_Range_Test return Node_Id;
-- Build the code for a range test of the form
-- Btyp!(Pref) in Btyp!(Ptyp'First) .. Btyp!(Ptyp'Last)
---------------------
-- Make_Range_Test --
---------------------
function Make_Range_Test return Node_Id is
Temp : constant Node_Id := Duplicate_Subexpr (Pref);
begin
-- The value whose validity is being checked has been captured in
-- an object declaration. We certainly don't want this object to
-- appear valid because the declaration initializes it.
if Is_Entity_Name (Temp) then
Set_Is_Known_Valid (Entity (Temp), False);
end if;
return
Make_In (Loc,
Left_Opnd =>
Unchecked_Convert_To (Btyp, Temp),
Right_Opnd =>
Make_Range (Loc,
Low_Bound =>
Unchecked_Convert_To (Btyp,
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Ptyp, Loc),
Attribute_Name => Name_First)),
High_Bound =>
Unchecked_Convert_To (Btyp,
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Ptyp, Loc),
Attribute_Name => Name_Last))));
end Make_Range_Test;
-- Start of processing for Attribute_Valid
begin
-- Do not expand sourced code 'Valid reference in CodePeer mode,
-- will be handled by the back-end directly.
if CodePeer_Mode and then Comes_From_Source (N) then
return;
end if;
-- Turn off validity checks. We do not want any implicit validity
-- checks to intefere with the explicit check from the attribute
Validity_Checks_On := False;
-- Retrieve the base type. Handle the case where the base type is a
-- private enumeration type.
if Is_Private_Type (Btyp) and then Present (Full_View (Btyp)) then
Btyp := Full_View (Btyp);
end if;
-- Floating-point case. This case is handled by the Valid attribute
-- code in the floating-point attribute run-time library.
if Is_Floating_Point_Type (Ptyp) then
Float_Valid : declare
Pkg : RE_Id;
Ftp : Entity_Id;
function Get_Fat_Entity (Nam : Name_Id) return Entity_Id;
-- Return entity for Pkg.Nam
--------------------
-- Get_Fat_Entity --
--------------------
function Get_Fat_Entity (Nam : Name_Id) return Entity_Id is
Exp_Name : constant Node_Id :=
Make_Selected_Component (Loc,
Prefix => New_Occurrence_Of (RTE (Pkg), Loc),
Selector_Name => Make_Identifier (Loc, Nam));
begin
Find_Selected_Component (Exp_Name);
return Entity (Exp_Name);
end Get_Fat_Entity;
-- Start of processing for Float_Valid
begin
-- The C and AAMP back-ends handle Valid for fpt types
if Modify_Tree_For_C or else Float_Rep (Btyp) = AAMP then
Analyze_And_Resolve (Pref, Ptyp);
Set_Etype (N, Standard_Boolean);
Set_Analyzed (N);
else
Find_Fat_Info (Ptyp, Ftp, Pkg);
-- If the prefix is a reverse SSO component, or is possibly
-- unaligned, first create a temporary copy that is in
-- native SSO, and properly aligned. Make it Volatile to
-- prevent folding in the back-end. Note that we use an
-- intermediate constrained string type to initialize the
-- temporary, as the value at hand might be invalid, and in
-- that case it cannot be copied using a floating point
-- register.
if In_Reverse_Storage_Order_Object (Pref)
or else Is_Possibly_Unaligned_Object (Pref)
then
declare
Temp : constant Entity_Id :=
Make_Temporary (Loc, 'F');
Fat_S : constant Entity_Id :=
Get_Fat_Entity (Name_S);
-- Constrained string subtype of appropriate size
Fat_P : constant Entity_Id :=
Get_Fat_Entity (Name_P);
-- Access to Fat_S
Decl : constant Node_Id :=
Make_Object_Declaration (Loc,
Defining_Identifier => Temp,
Aliased_Present => True,
Object_Definition =>
New_Occurrence_Of (Ptyp, Loc));
begin
Set_Aspect_Specifications (Decl, New_List (
Make_Aspect_Specification (Loc,
Identifier =>
Make_Identifier (Loc, Name_Volatile))));
Insert_Actions (N,
New_List (
Decl,
Make_Assignment_Statement (Loc,
Name =>
Make_Explicit_Dereference (Loc,
Prefix =>
Unchecked_Convert_To (Fat_P,
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of (Temp, Loc),
Attribute_Name =>
Name_Unrestricted_Access))),
Expression =>
Unchecked_Convert_To (Fat_S,
Relocate_Node (Pref)))),
Suppress => All_Checks);
Rewrite (Pref, New_Occurrence_Of (Temp, Loc));
end;
end if;
-- We now have an object of the proper endianness and
-- alignment, and can construct a Valid attribute.
-- We make sure the prefix of this valid attribute is
-- marked as not coming from source, to avoid losing
-- warnings from 'Valid looking like a possible update.
Set_Comes_From_Source (Pref, False);
Expand_Fpt_Attribute
(N, Pkg, Name_Valid,
New_List (
Make_Attribute_Reference (Loc,
Prefix => Unchecked_Convert_To (Ftp, Pref),
Attribute_Name => Name_Unrestricted_Access)));
end if;
-- One more task, we still need a range check. Required
-- only if we have a constraint, since the Valid routine
-- catches infinities properly (infinities are never valid).
-- The way we do the range check is simply to create the
-- expression: Valid (N) and then Base_Type(Pref) in Typ.
if not Subtypes_Statically_Match (Ptyp, Btyp) then
Rewrite (N,
Make_And_Then (Loc,
Left_Opnd => Relocate_Node (N),
Right_Opnd =>
Make_In (Loc,
Left_Opnd => Convert_To (Btyp, Pref),
Right_Opnd => New_Occurrence_Of (Ptyp, Loc))));
end if;
end Float_Valid;
-- Enumeration type with holes
-- For enumeration types with holes, the Pos value constructed by
-- the Enum_Rep_To_Pos function built in Exp_Ch3 called with a
-- second argument of False returns minus one for an invalid value,
-- and the non-negative pos value for a valid value, so the
-- expansion of X'Valid is simply:
-- type(X)'Pos (X) >= 0
-- We can't quite generate it that way because of the requirement
-- for the non-standard second argument of False in the resulting
-- rep_to_pos call, so we have to explicitly create:
-- _rep_to_pos (X, False) >= 0
-- If we have an enumeration subtype, we also check that the
-- value is in range:
-- _rep_to_pos (X, False) >= 0
-- and then
-- (X >= type(X)'First and then type(X)'Last <= X)
elsif Is_Enumeration_Type (Ptyp)
and then Present (Enum_Pos_To_Rep (Btyp))
then
Tst :=
Make_Op_Ge (Loc,
Left_Opnd =>
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (TSS (Btyp, TSS_Rep_To_Pos), Loc),
Parameter_Associations => New_List (
Pref,
New_Occurrence_Of (Standard_False, Loc))),
Right_Opnd => Make_Integer_Literal (Loc, 0));
if Ptyp /= Btyp
and then
(Type_Low_Bound (Ptyp) /= Type_Low_Bound (Btyp)
or else
Type_High_Bound (Ptyp) /= Type_High_Bound (Btyp))
then
-- The call to Make_Range_Test will create declarations
-- that need a proper insertion point, but Pref is now
-- attached to a node with no ancestor. Attach to tree
-- even if it is to be rewritten below.
Set_Parent (Tst, Parent (N));
Tst :=
Make_And_Then (Loc,
Left_Opnd => Make_Range_Test,
Right_Opnd => Tst);
end if;
Rewrite (N, Tst);
-- Fortran convention booleans
-- For the very special case of Fortran convention booleans, the
-- value is always valid, since it is an integer with the semantics
-- that non-zero is true, and any value is permissible.
elsif Is_Boolean_Type (Ptyp)
and then Convention (Ptyp) = Convention_Fortran
then
Rewrite (N, New_Occurrence_Of (Standard_True, Loc));
-- For biased representations, we will be doing an unchecked
-- conversion without unbiasing the result. That means that the range
-- test has to take this into account, and the proper form of the
-- test is:
-- Btyp!(Pref) < Btyp!(Ptyp'Range_Length)
elsif Has_Biased_Representation (Ptyp) then
Btyp := RTE (RE_Unsigned_32);
Rewrite (N,
Make_Op_Lt (Loc,
Left_Opnd =>
Unchecked_Convert_To (Btyp, Duplicate_Subexpr (Pref)),
Right_Opnd =>
Unchecked_Convert_To (Btyp,
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Ptyp, Loc),
Attribute_Name => Name_Range_Length))));
-- For all other scalar types, what we want logically is a
-- range test:
-- X in type(X)'First .. type(X)'Last
-- But that's precisely what won't work because of possible
-- unwanted optimization (and indeed the basic motivation for
-- the Valid attribute is exactly that this test does not work).
-- What will work is:
-- Btyp!(X) >= Btyp!(type(X)'First)
-- and then
-- Btyp!(X) <= Btyp!(type(X)'Last)
-- where Btyp is an integer type large enough to cover the full
-- range of possible stored values (i.e. it is chosen on the basis
-- of the size of the type, not the range of the values). We write
-- this as two tests, rather than a range check, so that static
-- evaluation will easily remove either or both of the checks if
-- they can be -statically determined to be true (this happens
-- when the type of X is static and the range extends to the full
-- range of stored values).
-- Unsigned types. Note: it is safe to consider only whether the
-- subtype is unsigned, since we will in that case be doing all
-- unsigned comparisons based on the subtype range. Since we use the
-- actual subtype object size, this is appropriate.
-- For example, if we have
-- subtype x is integer range 1 .. 200;
-- for x'Object_Size use 8;
-- Now the base type is signed, but objects of this type are bits
-- unsigned, and doing an unsigned test of the range 1 to 200 is
-- correct, even though a value greater than 127 looks signed to a
-- signed comparison.
elsif Is_Unsigned_Type (Ptyp) then
if Esize (Ptyp) <= 32 then
Btyp := RTE (RE_Unsigned_32);
else
Btyp := RTE (RE_Unsigned_64);
end if;
Rewrite (N, Make_Range_Test);
-- Signed types
else
if Esize (Ptyp) <= Esize (Standard_Integer) then
Btyp := Standard_Integer;
else
Btyp := Universal_Integer;
end if;
Rewrite (N, Make_Range_Test);
end if;
-- If a predicate is present, then we do the predicate test, even if
-- within the predicate function (infinite recursion is warned about
-- in Sem_Attr in that case).
declare
Pred_Func : constant Entity_Id := Predicate_Function (Ptyp);
begin
if Present (Pred_Func) then
Rewrite (N,
Make_And_Then (Loc,
Left_Opnd => Relocate_Node (N),
Right_Opnd => Make_Predicate_Call (Ptyp, Pref)));
end if;
end;
Analyze_And_Resolve (N, Standard_Boolean);
Validity_Checks_On := Save_Validity_Checks_On;
end Valid;
-------------------
-- Valid_Scalars --
-------------------
when Attribute_Valid_Scalars => Valid_Scalars : declare
Ftyp : Entity_Id;
begin
if Present (Underlying_Type (Ptyp)) then
Ftyp := Underlying_Type (Ptyp);
else
Ftyp := Ptyp;
end if;
-- Replace by True if no scalar parts
if not Scalar_Part_Present (Ftyp) then
Rewrite (N, New_Occurrence_Of (Standard_True, Loc));
-- For scalar types, Valid_Scalars is the same as Valid
elsif Is_Scalar_Type (Ftyp) then
Rewrite (N,
Make_Attribute_Reference (Loc,
Attribute_Name => Name_Valid,
Prefix => Pref));
-- For array types, we construct a function that determines if there
-- are any non-valid scalar subcomponents, and call the function.
-- We only do this for arrays whose component type needs checking
elsif Is_Array_Type (Ftyp)
and then Scalar_Part_Present (Component_Type (Ftyp))
then
Rewrite (N,
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (Build_Array_VS_Func (Ftyp, N), Loc),
Parameter_Associations => New_List (Pref)));
-- For record types, we construct a function that determines if there
-- are any non-valid scalar subcomponents, and call the function.
elsif Is_Record_Type (Ftyp)
and then Nkind (Type_Definition (Declaration_Node (Ftyp))) =
N_Record_Definition
then
Rewrite (N,
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (Build_Record_VS_Func (Ftyp, N), Loc),
Parameter_Associations => New_List (Pref)));
-- Other record types or types with discriminants
elsif Is_Record_Type (Ftyp) or else Has_Discriminants (Ptyp) then
-- Build expression with list of equality tests
declare
C : Entity_Id;
X : Node_Id;
A : Name_Id;
begin
X := New_Occurrence_Of (Standard_True, Loc);
C := First_Component_Or_Discriminant (Ptyp);
while Present (C) loop
if not Scalar_Part_Present (Etype (C)) then
goto Continue;
elsif Is_Scalar_Type (Etype (C)) then
A := Name_Valid;
else
A := Name_Valid_Scalars;
end if;
X :=
Make_And_Then (Loc,
Left_Opnd => X,
Right_Opnd =>
Make_Attribute_Reference (Loc,
Attribute_Name => A,
Prefix =>
Make_Selected_Component (Loc,
Prefix =>
Duplicate_Subexpr (Pref, Name_Req => True),
Selector_Name =>
New_Occurrence_Of (C, Loc))));
<<Continue>>
Next_Component_Or_Discriminant (C);
end loop;
Rewrite (N, X);
end;
-- For all other types, result is True
else
Rewrite (N, New_Occurrence_Of (Standard_Boolean, Loc));
end if;
-- Result is always boolean, but never static
Analyze_And_Resolve (N, Standard_Boolean);
Set_Is_Static_Expression (N, False);
end Valid_Scalars;
-----------
-- Value --
-----------
-- Value attribute is handled in separate unit Exp_Imgv
when Attribute_Value =>
Exp_Imgv.Expand_Value_Attribute (N);
-----------------
-- Value_Size --
-----------------
-- The processing for Value_Size shares the processing for Size
-------------
-- Version --
-------------
-- The processing for Version shares the processing for Body_Version
----------------
-- Wide_Image --
----------------
-- Wide_Image attribute is handled in separate unit Exp_Imgv
when Attribute_Wide_Image =>
Exp_Imgv.Expand_Wide_Image_Attribute (N);
---------------------
-- Wide_Wide_Image --
---------------------
-- Wide_Wide_Image attribute is handled in separate unit Exp_Imgv
when Attribute_Wide_Wide_Image =>
Exp_Imgv.Expand_Wide_Wide_Image_Attribute (N);
----------------
-- Wide_Value --
----------------
-- We expand typ'Wide_Value (X) into
-- typ'Value
-- (Wide_String_To_String (X, Wide_Character_Encoding_Method))
-- Wide_String_To_String is a runtime function that converts its wide
-- string argument to String, converting any non-translatable characters
-- into appropriate escape sequences. This preserves the required
-- semantics of Wide_Value in all cases, and results in a very simple
-- implementation approach.
-- Note: for this approach to be fully standard compliant for the cases
-- where typ is Wide_Character and Wide_Wide_Character, the encoding
-- method must cover the entire character range (e.g. UTF-8). But that
-- is a reasonable requirement when dealing with encoded character
-- sequences. Presumably if one of the restrictive encoding mechanisms
-- is in use such as Shift-JIS, then characters that cannot be
-- represented using this encoding will not appear in any case.
when Attribute_Wide_Value =>
Rewrite (N,
Make_Attribute_Reference (Loc,
Prefix => Pref,
Attribute_Name => Name_Value,
Expressions => New_List (
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of (RTE (RE_Wide_String_To_String), Loc),
Parameter_Associations => New_List (
Relocate_Node (First (Exprs)),
Make_Integer_Literal (Loc,
Intval => Int (Wide_Character_Encoding_Method)))))));
Analyze_And_Resolve (N, Typ);
---------------------
-- Wide_Wide_Value --
---------------------
-- We expand typ'Wide_Value_Value (X) into
-- typ'Value
-- (Wide_Wide_String_To_String (X, Wide_Character_Encoding_Method))
-- Wide_Wide_String_To_String is a runtime function that converts its
-- wide string argument to String, converting any non-translatable
-- characters into appropriate escape sequences. This preserves the
-- required semantics of Wide_Wide_Value in all cases, and results in a
-- very simple implementation approach.
-- It's not quite right where typ = Wide_Wide_Character, because the
-- encoding method may not cover the whole character type ???
when Attribute_Wide_Wide_Value =>
Rewrite (N,
Make_Attribute_Reference (Loc,
Prefix => Pref,
Attribute_Name => Name_Value,
Expressions => New_List (
Make_Function_Call (Loc,
Name =>
New_Occurrence_Of
(RTE (RE_Wide_Wide_String_To_String), Loc),
Parameter_Associations => New_List (
Relocate_Node (First (Exprs)),
Make_Integer_Literal (Loc,
Intval => Int (Wide_Character_Encoding_Method)))))));
Analyze_And_Resolve (N, Typ);
---------------------
-- Wide_Wide_Width --
---------------------
-- Wide_Wide_Width attribute is handled in separate unit Exp_Imgv
when Attribute_Wide_Wide_Width =>
Exp_Imgv.Expand_Width_Attribute (N, Wide_Wide);
----------------
-- Wide_Width --
----------------
-- Wide_Width attribute is handled in separate unit Exp_Imgv
when Attribute_Wide_Width =>
Exp_Imgv.Expand_Width_Attribute (N, Wide);
-----------
-- Width --
-----------
-- Width attribute is handled in separate unit Exp_Imgv
when Attribute_Width =>
Exp_Imgv.Expand_Width_Attribute (N, Normal);
-----------
-- Write --
-----------
when Attribute_Write => Write : declare
P_Type : constant Entity_Id := Entity (Pref);
U_Type : constant Entity_Id := Underlying_Type (P_Type);
Pname : Entity_Id;
Decl : Node_Id;
Prag : Node_Id;
Arg3 : Node_Id;
Wfunc : Node_Id;
begin
-- If no underlying type, we have an error that will be diagnosed
-- elsewhere, so here we just completely ignore the expansion.
if No (U_Type) then
return;
end if;
-- Stream operations can appear in user code even if the restriction
-- No_Streams is active (for example, when instantiating a predefined
-- container). In that case rewrite the attribute as a Raise to
-- prevent any run-time use.
if Restriction_Active (No_Streams) then
Rewrite (N,
Make_Raise_Program_Error (Sloc (N),
Reason => PE_Stream_Operation_Not_Allowed));
Set_Etype (N, U_Type);
return;
end if;
-- The simple case, if there is a TSS for Write, just call it
Pname := Find_Stream_Subprogram (P_Type, TSS_Stream_Write);
if Present (Pname) then
null;
else
-- If there is a Stream_Convert pragma, use it, we rewrite
-- sourcetyp'Output (stream, Item)
-- as
-- strmtyp'Output (Stream, strmwrite (acttyp (Item)));
-- where strmwrite is the given Write function that converts an
-- argument of type sourcetyp or a type acctyp, from which it is
-- derived to type strmtyp. The conversion to acttyp is required
-- for the derived case.
Prag := Get_Stream_Convert_Pragma (P_Type);
if Present (Prag) then
Arg3 :=
Next (Next (First (Pragma_Argument_Associations (Prag))));
Wfunc := Entity (Expression (Arg3));
Rewrite (N,
Make_Attribute_Reference (Loc,
Prefix => New_Occurrence_Of (Etype (Wfunc), Loc),
Attribute_Name => Name_Output,
Expressions => New_List (
Relocate_Node (First (Exprs)),
Make_Function_Call (Loc,
Name => New_Occurrence_Of (Wfunc, Loc),
Parameter_Associations => New_List (
OK_Convert_To (Etype (First_Formal (Wfunc)),
Relocate_Node (Next (First (Exprs)))))))));
Analyze (N);
return;
-- For elementary types, we call the W_xxx routine directly
elsif Is_Elementary_Type (U_Type) then
Rewrite (N, Build_Elementary_Write_Call (N));
Analyze (N);
return;
-- Array type case
elsif Is_Array_Type (U_Type) then
Build_Array_Write_Procedure (N, U_Type, Decl, Pname);
Compile_Stream_Body_In_Scope (N, Decl, U_Type, Check => False);
-- Tagged type case, use the primitive Write function. Note that
-- this will dispatch in the class-wide case which is what we want
elsif Is_Tagged_Type (U_Type) then
Pname := Find_Prim_Op (U_Type, TSS_Stream_Write);
-- All other record type cases, including protected records.
-- The latter only arise for expander generated code for
-- handling shared passive partition access.
else
pragma Assert
(Is_Record_Type (U_Type) or else Is_Protected_Type (U_Type));
-- Ada 2005 (AI-216): Program_Error is raised when executing
-- the default implementation of the Write attribute of an
-- Unchecked_Union type. However, if the 'Write reference is
-- within the generated Output stream procedure, Write outputs
-- the components, and the default values of the discriminant
-- are streamed by the Output procedure itself.
if Is_Unchecked_Union (Base_Type (U_Type))
and not Is_TSS (Current_Scope, TSS_Stream_Output)
then
Insert_Action (N,
Make_Raise_Program_Error (Loc,
Reason => PE_Unchecked_Union_Restriction));
end if;
if Has_Discriminants (U_Type)
and then Present
(Discriminant_Default_Value (First_Discriminant (U_Type)))
then
Build_Mutable_Record_Write_Procedure
(Loc, Full_Base (U_Type), Decl, Pname);
else
Build_Record_Write_Procedure
(Loc, Full_Base (U_Type), Decl, Pname);
end if;
Insert_Action (N, Decl);
end if;
end if;
-- If we fall through, Pname is the procedure to be called
Rewrite_Stream_Proc_Call (Pname);
end Write;
-- Component_Size is handled by the back end, unless the component size
-- is known at compile time, which is always true in the packed array
-- case. It is important that the packed array case is handled in the
-- front end (see Eval_Attribute) since the back end would otherwise get
-- confused by the equivalent packed array type.
when Attribute_Component_Size =>
null;
-- The following attributes are handled by the back end (except that
-- static cases have already been evaluated during semantic processing,
-- but in any case the back end should not count on this).
-- The back end also handles the non-class-wide cases of Size
when Attribute_Bit_Order
| Attribute_Code_Address
| Attribute_Definite
| Attribute_Deref
| Attribute_Null_Parameter
| Attribute_Passed_By_Reference
| Attribute_Pool_Address
| Attribute_Scalar_Storage_Order
=>
null;
-- The following attributes are also handled by the back end, but return
-- a universal integer result, so may need a conversion for checking
-- that the result is in range.
when Attribute_Aft
| Attribute_Max_Alignment_For_Allocation
=>
Apply_Universal_Integer_Attribute_Checks (N);
-- The following attributes should not appear at this stage, since they
-- have already been handled by the analyzer (and properly rewritten
-- with corresponding values or entities to represent the right values)
when Attribute_Abort_Signal
| Attribute_Address_Size
| Attribute_Atomic_Always_Lock_Free
| Attribute_Base
| Attribute_Class
| Attribute_Compiler_Version
| Attribute_Default_Bit_Order
| Attribute_Default_Scalar_Storage_Order
| Attribute_Delta
| Attribute_Denorm
| Attribute_Digits
| Attribute_Emax
| Attribute_Enabled
| Attribute_Epsilon
| Attribute_Fast_Math
| Attribute_First_Valid
| Attribute_Has_Access_Values
| Attribute_Has_Discriminants
| Attribute_Has_Tagged_Values
| Attribute_Large
| Attribute_Last_Valid
| Attribute_Library_Level
| Attribute_Lock_Free
| Attribute_Machine_Emax
| Attribute_Machine_Emin
| Attribute_Machine_Mantissa
| Attribute_Machine_Overflows
| Attribute_Machine_Radix
| Attribute_Machine_Rounds
| Attribute_Maximum_Alignment
| Attribute_Model_Emin
| Attribute_Model_Epsilon
| Attribute_Model_Mantissa
| Attribute_Model_Small
| Attribute_Modulus
| Attribute_Partition_ID
| Attribute_Range
| Attribute_Restriction_Set
| Attribute_Safe_Emax
| Attribute_Safe_First
| Attribute_Safe_Large
| Attribute_Safe_Last
| Attribute_Safe_Small
| Attribute_Scale
| Attribute_Signed_Zeros
| Attribute_Small
| Attribute_Storage_Unit
| Attribute_Stub_Type
| Attribute_System_Allocator_Alignment
| Attribute_Target_Name
| Attribute_Type_Class
| Attribute_Type_Key
| Attribute_Unconstrained_Array
| Attribute_Universal_Literal_String
| Attribute_Wchar_T_Size
| Attribute_Word_Size
=>
raise Program_Error;
-- The Asm_Input and Asm_Output attributes are not expanded at this
-- stage, but will be eliminated in the expansion of the Asm call, see
-- Exp_Intr for details. So the back end will never see these either.
when Attribute_Asm_Input
| Attribute_Asm_Output
=>
null;
end case;
-- Note: as mentioned earlier, individual sections of the above case
-- statement assume there is no code after the case statement, and are
-- legitimately allowed to execute return statements if they have nothing
-- more to do, so DO NOT add code at this point.
exception
when RE_Not_Available =>
return;
end Expand_N_Attribute_Reference;
--------------------------------
-- Expand_Pred_Succ_Attribute --
--------------------------------
-- For typ'Pred (exp), we generate the check
-- [constraint_error when exp = typ'Base'First]
-- Similarly, for typ'Succ (exp), we generate the check
-- [constraint_error when exp = typ'Base'Last]
-- These checks are not generated for modular types, since the proper
-- semantics for Succ and Pred on modular types is to wrap, not raise CE.
-- We also suppress these checks if we are the right side of an assignment
-- statement or the expression of an object declaration, where the flag
-- Suppress_Assignment_Checks is set for the assignment/declaration.
procedure Expand_Pred_Succ_Attribute (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
P : constant Node_Id := Parent (N);
Cnam : Name_Id;
begin
if Attribute_Name (N) = Name_Pred then
Cnam := Name_First;
else
Cnam := Name_Last;
end if;
if not Nkind_In (P, N_Assignment_Statement, N_Object_Declaration)
or else not Suppress_Assignment_Checks (P)
then
Insert_Action (N,
Make_Raise_Constraint_Error (Loc,
Condition =>
Make_Op_Eq (Loc,
Left_Opnd =>
Duplicate_Subexpr_Move_Checks (First (Expressions (N))),
Right_Opnd =>
Make_Attribute_Reference (Loc,
Prefix =>
New_Occurrence_Of (Base_Type (Etype (Prefix (N))), Loc),
Attribute_Name => Cnam)),
Reason => CE_Overflow_Check_Failed));
end if;
end Expand_Pred_Succ_Attribute;
-----------------------------
-- Expand_Update_Attribute --
-----------------------------
procedure Expand_Update_Attribute (N : Node_Id) is
procedure Process_Component_Or_Element_Update
(Temp : Entity_Id;
Comp : Node_Id;
Expr : Node_Id;
Typ : Entity_Id);
-- Generate the statements necessary to update a single component or an
-- element of the prefix. The code is inserted before the attribute N.
-- Temp denotes the entity of the anonymous object created to reflect
-- the changes in values. Comp is the component/index expression to be
-- updated. Expr is an expression yielding the new value of Comp. Typ
-- is the type of the prefix of attribute Update.
procedure Process_Range_Update
(Temp : Entity_Id;
Comp : Node_Id;
Expr : Node_Id;
Typ : Entity_Id);
-- Generate the statements necessary to update a slice of the prefix.
-- The code is inserted before the attribute N. Temp denotes the entity
-- of the anonymous object created to reflect the changes in values.
-- Comp is range of the slice to be updated. Expr is an expression
-- yielding the new value of Comp. Typ is the type of the prefix of
-- attribute Update.
-----------------------------------------
-- Process_Component_Or_Element_Update --
-----------------------------------------
procedure Process_Component_Or_Element_Update
(Temp : Entity_Id;
Comp : Node_Id;
Expr : Node_Id;
Typ : Entity_Id)
is
Loc : constant Source_Ptr := Sloc (Comp);
Exprs : List_Id;
LHS : Node_Id;
begin
-- An array element may be modified by the following relations
-- depending on the number of dimensions:
-- 1 => Expr -- one dimensional update
-- (1, ..., N) => Expr -- multi dimensional update
-- The above forms are converted in assignment statements where the
-- left hand side is an indexed component:
-- Temp (1) := Expr; -- one dimensional update
-- Temp (1, ..., N) := Expr; -- multi dimensional update
if Is_Array_Type (Typ) then
-- The index expressions of a multi dimensional array update
-- appear as an aggregate.
if Nkind (Comp) = N_Aggregate then
Exprs := New_Copy_List_Tree (Expressions (Comp));
else
Exprs := New_List (Relocate_Node (Comp));
end if;
LHS :=
Make_Indexed_Component (Loc,
Prefix => New_Occurrence_Of (Temp, Loc),
Expressions => Exprs);
-- A record component update appears in the following form:
-- Comp => Expr
-- The above relation is transformed into an assignment statement
-- where the left hand side is a selected component:
-- Temp.Comp := Expr;
else pragma Assert (Is_Record_Type (Typ));
LHS :=
Make_Selected_Component (Loc,
Prefix => New_Occurrence_Of (Temp, Loc),
Selector_Name => Relocate_Node (Comp));
end if;
Insert_Action (N,
Make_Assignment_Statement (Loc,
Name => LHS,
Expression => Relocate_Node (Expr)));
end Process_Component_Or_Element_Update;
--------------------------
-- Process_Range_Update --
--------------------------
procedure Process_Range_Update
(Temp : Entity_Id;
Comp : Node_Id;
Expr : Node_Id;
Typ : Entity_Id)
is
Index_Typ : constant Entity_Id := Etype (First_Index (Typ));
Loc : constant Source_Ptr := Sloc (Comp);
Index : Entity_Id;
begin
-- A range update appears as
-- (Low .. High => Expr)
-- The above construct is transformed into a loop that iterates over
-- the given range and modifies the corresponding array values to the
-- value of Expr:
-- for Index in Low .. High loop
-- Temp (<Index_Typ> (Index)) := Expr;
-- end loop;
Index := Make_Temporary (Loc, 'I');
Insert_Action (N,
Make_Loop_Statement (Loc,
Iteration_Scheme =>
Make_Iteration_Scheme (Loc,
Loop_Parameter_Specification =>
Make_Loop_Parameter_Specification (Loc,
Defining_Identifier => Index,
Discrete_Subtype_Definition => Relocate_Node (Comp))),
Statements => New_List (
Make_Assignment_Statement (Loc,
Name =>
Make_Indexed_Component (Loc,
Prefix => New_Occurrence_Of (Temp, Loc),
Expressions => New_List (
Convert_To (Index_Typ,
New_Occurrence_Of (Index, Loc)))),
Expression => Relocate_Node (Expr))),
End_Label => Empty));
end Process_Range_Update;
-- Local variables
Aggr : constant Node_Id := First (Expressions (N));
Loc : constant Source_Ptr := Sloc (N);
Pref : constant Node_Id := Prefix (N);
Typ : constant Entity_Id := Etype (Pref);
Assoc : Node_Id;
Comp : Node_Id;
CW_Temp : Entity_Id;
CW_Typ : Entity_Id;
Expr : Node_Id;
Temp : Entity_Id;
-- Start of processing for Expand_Update_Attribute
begin
-- Create the anonymous object to store the value of the prefix and
-- capture subsequent changes in value.
Temp := Make_Temporary (Loc, 'T', Pref);
-- Preserve the tag of the prefix by offering a specific view of the
-- class-wide version of the prefix.
if Is_Tagged_Type (Typ) then
-- Generate:
-- CW_Temp : Typ'Class := Typ'Class (Pref);
CW_Temp := Make_Temporary (Loc, 'T');
CW_Typ := Class_Wide_Type (Typ);
Insert_Action (N,
Make_Object_Declaration (Loc,
Defining_Identifier => CW_Temp,
Object_Definition => New_Occurrence_Of (CW_Typ, Loc),
Expression =>
Convert_To (CW_Typ, Relocate_Node (Pref))));
-- Generate:
-- Temp : Typ renames Typ (CW_Temp);
Insert_Action (N,
Make_Object_Renaming_Declaration (Loc,
Defining_Identifier => Temp,
Subtype_Mark => New_Occurrence_Of (Typ, Loc),
Name =>
Convert_To (Typ, New_Occurrence_Of (CW_Temp, Loc))));
-- Non-tagged case
else
-- Generate:
-- Temp : Typ := Pref;
Insert_Action (N,
Make_Object_Declaration (Loc,
Defining_Identifier => Temp,
Object_Definition => New_Occurrence_Of (Typ, Loc),
Expression => Relocate_Node (Pref)));
end if;
-- Process the update aggregate
Assoc := First (Component_Associations (Aggr));
while Present (Assoc) loop
Comp := First (Choices (Assoc));
Expr := Expression (Assoc);
while Present (Comp) loop
if Nkind (Comp) = N_Range then
Process_Range_Update (Temp, Comp, Expr, Typ);
else
Process_Component_Or_Element_Update (Temp, Comp, Expr, Typ);
end if;
Next (Comp);
end loop;
Next (Assoc);
end loop;
-- The attribute is replaced by a reference to the anonymous object
Rewrite (N, New_Occurrence_Of (Temp, Loc));
Analyze (N);
end Expand_Update_Attribute;
-------------------
-- Find_Fat_Info --
-------------------
procedure Find_Fat_Info
(T : Entity_Id;
Fat_Type : out Entity_Id;
Fat_Pkg : out RE_Id)
is
Rtyp : constant Entity_Id := Root_Type (T);
begin
-- All we do is use the root type (historically this dealt with
-- VAX-float .. to be cleaned up further later ???)
Fat_Type := Rtyp;
if Fat_Type = Standard_Short_Float then
Fat_Pkg := RE_Attr_Short_Float;
elsif Fat_Type = Standard_Float then
Fat_Pkg := RE_Attr_Float;
elsif Fat_Type = Standard_Long_Float then
Fat_Pkg := RE_Attr_Long_Float;
elsif Fat_Type = Standard_Long_Long_Float then
Fat_Pkg := RE_Attr_Long_Long_Float;
-- Universal real (which is its own root type) is treated as being
-- equivalent to Standard.Long_Long_Float, since it is defined to
-- have the same precision as the longest Float type.
elsif Fat_Type = Universal_Real then
Fat_Type := Standard_Long_Long_Float;
Fat_Pkg := RE_Attr_Long_Long_Float;
else
raise Program_Error;
end if;
end Find_Fat_Info;
----------------------------
-- Find_Stream_Subprogram --
----------------------------
function Find_Stream_Subprogram
(Typ : Entity_Id;
Nam : TSS_Name_Type) return Entity_Id
is
Base_Typ : constant Entity_Id := Base_Type (Typ);
Ent : constant Entity_Id := TSS (Typ, Nam);
function Is_Available (Entity : RE_Id) return Boolean;
pragma Inline (Is_Available);
-- Function to check whether the specified run-time call is available
-- in the run time used. In the case of a configurable run time, it
-- is normal that some subprograms are not there.
--
-- I don't understand this routine at all, why is this not just a
-- call to RTE_Available? And if for some reason we need a different
-- routine with different semantics, why is not in Rtsfind ???
------------------
-- Is_Available --
------------------
function Is_Available (Entity : RE_Id) return Boolean is
begin
-- Assume that the unit will always be available when using a
-- "normal" (not configurable) run time.
return not Configurable_Run_Time_Mode or else RTE_Available (Entity);
end Is_Available;
-- Start of processing for Find_Stream_Subprogram
begin
if Present (Ent) then
return Ent;
end if;
-- Stream attributes for strings are expanded into library calls. The
-- following checks are disabled when the run-time is not available or
-- when compiling predefined types due to bootstrap issues. As a result,
-- the compiler will generate in-place stream routines for string types
-- that appear in GNAT's library, but will generate calls via rtsfind
-- to library routines for user code.
-- Note: In the case of using a configurable run time, it is very likely
-- that stream routines for string types are not present (they require
-- file system support). In this case, the specific stream routines for
-- strings are not used, relying on the regular stream mechanism
-- instead. That is why we include the test Is_Available when dealing
-- with these cases.
if not Is_Predefined_File_Name (Unit_File_Name (Current_Sem_Unit)) then
-- Storage_Array as defined in package System.Storage_Elements
if Is_RTE (Base_Typ, RE_Storage_Array) then
-- Case of No_Stream_Optimizations restriction active
if Restriction_Active (No_Stream_Optimizations) then
if Nam = TSS_Stream_Input
and then Is_Available (RE_Storage_Array_Input)
then
return RTE (RE_Storage_Array_Input);
elsif Nam = TSS_Stream_Output
and then Is_Available (RE_Storage_Array_Output)
then
return RTE (RE_Storage_Array_Output);
elsif Nam = TSS_Stream_Read
and then Is_Available (RE_Storage_Array_Read)
then
return RTE (RE_Storage_Array_Read);
elsif Nam = TSS_Stream_Write
and then Is_Available (RE_Storage_Array_Write)
then
return RTE (RE_Storage_Array_Write);
elsif Nam /= TSS_Stream_Input and then
Nam /= TSS_Stream_Output and then
Nam /= TSS_Stream_Read and then
Nam /= TSS_Stream_Write
then
raise Program_Error;
end if;
-- Restriction No_Stream_Optimizations is not set, so we can go
-- ahead and optimize using the block IO forms of the routines.
else
if Nam = TSS_Stream_Input
and then Is_Available (RE_Storage_Array_Input_Blk_IO)
then
return RTE (RE_Storage_Array_Input_Blk_IO);
elsif Nam = TSS_Stream_Output
and then Is_Available (RE_Storage_Array_Output_Blk_IO)
then
return RTE (RE_Storage_Array_Output_Blk_IO);
elsif Nam = TSS_Stream_Read
and then Is_Available (RE_Storage_Array_Read_Blk_IO)
then
return RTE (RE_Storage_Array_Read_Blk_IO);
elsif Nam = TSS_Stream_Write
and then Is_Available (RE_Storage_Array_Write_Blk_IO)
then
return RTE (RE_Storage_Array_Write_Blk_IO);
elsif Nam /= TSS_Stream_Input and then
Nam /= TSS_Stream_Output and then
Nam /= TSS_Stream_Read and then
Nam /= TSS_Stream_Write
then
raise Program_Error;
end if;
end if;
-- Stream_Element_Array as defined in package Ada.Streams
elsif Is_RTE (Base_Typ, RE_Stream_Element_Array) then
-- Case of No_Stream_Optimizations restriction active
if Restriction_Active (No_Stream_Optimizations) then
if Nam = TSS_Stream_Input
and then Is_Available (RE_Stream_Element_Array_Input)
then
return RTE (RE_Stream_Element_Array_Input);
elsif Nam = TSS_Stream_Output
and then Is_Available (RE_Stream_Element_Array_Output)
then
return RTE (RE_Stream_Element_Array_Output);
elsif Nam = TSS_Stream_Read
and then Is_Available (RE_Stream_Element_Array_Read)
then
return RTE (RE_Stream_Element_Array_Read);
elsif Nam = TSS_Stream_Write
and then Is_Available (RE_Stream_Element_Array_Write)
then
return RTE (RE_Stream_Element_Array_Write);
elsif Nam /= TSS_Stream_Input and then
Nam /= TSS_Stream_Output and then
Nam /= TSS_Stream_Read and then
Nam /= TSS_Stream_Write
then
raise Program_Error;
end if;
-- Restriction No_Stream_Optimizations is not set, so we can go
-- ahead and optimize using the block IO forms of the routines.
else
if Nam = TSS_Stream_Input
and then Is_Available (RE_Stream_Element_Array_Input_Blk_IO)
then
return RTE (RE_Stream_Element_Array_Input_Blk_IO);
elsif Nam = TSS_Stream_Output
and then Is_Available (RE_Stream_Element_Array_Output_Blk_IO)
then
return RTE (RE_Stream_Element_Array_Output_Blk_IO);
elsif Nam = TSS_Stream_Read
and then Is_Available (RE_Stream_Element_Array_Read_Blk_IO)
then
return RTE (RE_Stream_Element_Array_Read_Blk_IO);
elsif Nam = TSS_Stream_Write
and then Is_Available (RE_Stream_Element_Array_Write_Blk_IO)
then
return RTE (RE_Stream_Element_Array_Write_Blk_IO);
elsif Nam /= TSS_Stream_Input and then
Nam /= TSS_Stream_Output and then
Nam /= TSS_Stream_Read and then
Nam /= TSS_Stream_Write
then
raise Program_Error;
end if;
end if;
-- String as defined in package Ada
elsif Base_Typ = Standard_String then
-- Case of No_Stream_Optimizations restriction active
if Restriction_Active (No_Stream_Optimizations) then
if Nam = TSS_Stream_Input
and then Is_Available (RE_String_Input)
then
return RTE (RE_String_Input);
elsif Nam = TSS_Stream_Output
and then Is_Available (RE_String_Output)
then
return RTE (RE_String_Output);
elsif Nam = TSS_Stream_Read
and then Is_Available (RE_String_Read)
then
return RTE (RE_String_Read);
elsif Nam = TSS_Stream_Write
and then Is_Available (RE_String_Write)
then
return RTE (RE_String_Write);
elsif Nam /= TSS_Stream_Input and then
Nam /= TSS_Stream_Output and then
Nam /= TSS_Stream_Read and then
Nam /= TSS_Stream_Write
then
raise Program_Error;
end if;
-- Restriction No_Stream_Optimizations is not set, so we can go
-- ahead and optimize using the block IO forms of the routines.
else
if Nam = TSS_Stream_Input
and then Is_Available (RE_String_Input_Blk_IO)
then
return RTE (RE_String_Input_Blk_IO);
elsif Nam = TSS_Stream_Output
and then Is_Available (RE_String_Output_Blk_IO)
then
return RTE (RE_String_Output_Blk_IO);
elsif Nam = TSS_Stream_Read
and then Is_Available (RE_String_Read_Blk_IO)
then
return RTE (RE_String_Read_Blk_IO);
elsif Nam = TSS_Stream_Write
and then Is_Available (RE_String_Write_Blk_IO)
then
return RTE (RE_String_Write_Blk_IO);
elsif Nam /= TSS_Stream_Input and then
Nam /= TSS_Stream_Output and then
Nam /= TSS_Stream_Read and then
Nam /= TSS_Stream_Write
then
raise Program_Error;
end if;
end if;
-- Wide_String as defined in package Ada
elsif Base_Typ = Standard_Wide_String then
-- Case of No_Stream_Optimizations restriction active
if Restriction_Active (No_Stream_Optimizations) then
if Nam = TSS_Stream_Input
and then Is_Available (RE_Wide_String_Input)
then
return RTE (RE_Wide_String_Input);
elsif Nam = TSS_Stream_Output
and then Is_Available (RE_Wide_String_Output)
then
return RTE (RE_Wide_String_Output);
elsif Nam = TSS_Stream_Read
and then Is_Available (RE_Wide_String_Read)
then
return RTE (RE_Wide_String_Read);
elsif Nam = TSS_Stream_Write
and then Is_Available (RE_Wide_String_Write)
then
return RTE (RE_Wide_String_Write);
elsif Nam /= TSS_Stream_Input and then
Nam /= TSS_Stream_Output and then
Nam /= TSS_Stream_Read and then
Nam /= TSS_Stream_Write
then
raise Program_Error;
end if;
-- Restriction No_Stream_Optimizations is not set, so we can go
-- ahead and optimize using the block IO forms of the routines.
else
if Nam = TSS_Stream_Input
and then Is_Available (RE_Wide_String_Input_Blk_IO)
then
return RTE (RE_Wide_String_Input_Blk_IO);
elsif Nam = TSS_Stream_Output
and then Is_Available (RE_Wide_String_Output_Blk_IO)
then
return RTE (RE_Wide_String_Output_Blk_IO);
elsif Nam = TSS_Stream_Read
and then Is_Available (RE_Wide_String_Read_Blk_IO)
then
return RTE (RE_Wide_String_Read_Blk_IO);
elsif Nam = TSS_Stream_Write
and then Is_Available (RE_Wide_String_Write_Blk_IO)
then
return RTE (RE_Wide_String_Write_Blk_IO);
elsif Nam /= TSS_Stream_Input and then
Nam /= TSS_Stream_Output and then
Nam /= TSS_Stream_Read and then
Nam /= TSS_Stream_Write
then
raise Program_Error;
end if;
end if;
-- Wide_Wide_String as defined in package Ada
elsif Base_Typ = Standard_Wide_Wide_String then
-- Case of No_Stream_Optimizations restriction active
if Restriction_Active (No_Stream_Optimizations) then
if Nam = TSS_Stream_Input
and then Is_Available (RE_Wide_Wide_String_Input)
then
return RTE (RE_Wide_Wide_String_Input);
elsif Nam = TSS_Stream_Output
and then Is_Available (RE_Wide_Wide_String_Output)
then
return RTE (RE_Wide_Wide_String_Output);
elsif Nam = TSS_Stream_Read
and then Is_Available (RE_Wide_Wide_String_Read)
then
return RTE (RE_Wide_Wide_String_Read);
elsif Nam = TSS_Stream_Write
and then Is_Available (RE_Wide_Wide_String_Write)
then
return RTE (RE_Wide_Wide_String_Write);
elsif Nam /= TSS_Stream_Input and then
Nam /= TSS_Stream_Output and then
Nam /= TSS_Stream_Read and then
Nam /= TSS_Stream_Write
then
raise Program_Error;
end if;
-- Restriction No_Stream_Optimizations is not set, so we can go
-- ahead and optimize using the block IO forms of the routines.
else
if Nam = TSS_Stream_Input
and then Is_Available (RE_Wide_Wide_String_Input_Blk_IO)
then
return RTE (RE_Wide_Wide_String_Input_Blk_IO);
elsif Nam = TSS_Stream_Output
and then Is_Available (RE_Wide_Wide_String_Output_Blk_IO)
then
return RTE (RE_Wide_Wide_String_Output_Blk_IO);
elsif Nam = TSS_Stream_Read
and then Is_Available (RE_Wide_Wide_String_Read_Blk_IO)
then
return RTE (RE_Wide_Wide_String_Read_Blk_IO);
elsif Nam = TSS_Stream_Write
and then Is_Available (RE_Wide_Wide_String_Write_Blk_IO)
then
return RTE (RE_Wide_Wide_String_Write_Blk_IO);
elsif Nam /= TSS_Stream_Input and then
Nam /= TSS_Stream_Output and then
Nam /= TSS_Stream_Read and then
Nam /= TSS_Stream_Write
then
raise Program_Error;
end if;
end if;
end if;
end if;
if Is_Tagged_Type (Typ) and then Is_Derived_Type (Typ) then
return Find_Prim_Op (Typ, Nam);
else
return Find_Inherited_TSS (Typ, Nam);
end if;
end Find_Stream_Subprogram;
---------------
-- Full_Base --
---------------
function Full_Base (T : Entity_Id) return Entity_Id is
BT : Entity_Id;
begin
BT := Base_Type (T);
if Is_Private_Type (BT)
and then Present (Full_View (BT))
then
BT := Full_View (BT);
end if;
return BT;
end Full_Base;
-----------------------
-- Get_Index_Subtype --
-----------------------
function Get_Index_Subtype (N : Node_Id) return Node_Id is
P_Type : Entity_Id := Etype (Prefix (N));
Indx : Node_Id;
J : Int;
begin
if Is_Access_Type (P_Type) then
P_Type := Designated_Type (P_Type);
end if;
if No (Expressions (N)) then
J := 1;
else
J := UI_To_Int (Expr_Value (First (Expressions (N))));
end if;
Indx := First_Index (P_Type);
while J > 1 loop
Next_Index (Indx);
J := J - 1;
end loop;
return Etype (Indx);
end Get_Index_Subtype;
-------------------------------
-- Get_Stream_Convert_Pragma --
-------------------------------
function Get_Stream_Convert_Pragma (T : Entity_Id) return Node_Id is
Typ : Entity_Id;
N : Node_Id;
begin
-- Note: we cannot use Get_Rep_Pragma here because of the peculiarity
-- that a stream convert pragma for a tagged type is not inherited from
-- its parent. Probably what is wrong here is that it is basically
-- incorrect to consider a stream convert pragma to be a representation
-- pragma at all ???
N := First_Rep_Item (Implementation_Base_Type (T));
while Present (N) loop
if Nkind (N) = N_Pragma
and then Pragma_Name (N) = Name_Stream_Convert
then
-- For tagged types this pragma is not inherited, so we
-- must verify that it is defined for the given type and
-- not an ancestor.
Typ :=
Entity (Expression (First (Pragma_Argument_Associations (N))));
if not Is_Tagged_Type (T)
or else T = Typ
or else (Is_Private_Type (Typ) and then T = Full_View (Typ))
then
return N;
end if;
end if;
Next_Rep_Item (N);
end loop;
return Empty;
end Get_Stream_Convert_Pragma;
---------------------------------
-- Is_Constrained_Packed_Array --
---------------------------------
function Is_Constrained_Packed_Array (Typ : Entity_Id) return Boolean is
Arr : Entity_Id := Typ;
begin
if Is_Access_Type (Arr) then
Arr := Designated_Type (Arr);
end if;
return Is_Array_Type (Arr)
and then Is_Constrained (Arr)
and then Present (Packed_Array_Impl_Type (Arr));
end Is_Constrained_Packed_Array;
----------------------------------------
-- Is_Inline_Floating_Point_Attribute --
----------------------------------------
function Is_Inline_Floating_Point_Attribute (N : Node_Id) return Boolean is
Id : constant Attribute_Id := Get_Attribute_Id (Attribute_Name (N));
function Is_GCC_Target return Boolean;
-- Return True if we are using a GCC target/back-end
-- ??? Note: the implementation is kludgy/fragile
-------------------
-- Is_GCC_Target --
-------------------
function Is_GCC_Target return Boolean is
begin
return not CodePeer_Mode
and then not AAMP_On_Target
and then not Modify_Tree_For_C;
end Is_GCC_Target;
-- Start of processing for Is_Inline_Floating_Point_Attribute
begin
-- Machine and Model can be expanded by the GCC and AAMP back ends only
if Id = Attribute_Machine or else Id = Attribute_Model then
return Is_GCC_Target or else AAMP_On_Target;
-- Remaining cases handled by all back ends are Rounding and Truncation
-- when appearing as the operand of a conversion to some integer type.
elsif Nkind (Parent (N)) /= N_Type_Conversion
or else not Is_Integer_Type (Etype (Parent (N)))
then
return False;
end if;
-- Here we are in the integer conversion context
-- Very probably we should also recognize the cases of Machine_Rounding
-- and unbiased rounding in this conversion context, but the back end is
-- not yet prepared to handle these cases ???
return Id = Attribute_Rounding or else Id = Attribute_Truncation;
end Is_Inline_Floating_Point_Attribute;
end Exp_Attr;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . T E X T _ I O . F I X E D _ I O --
-- --
-- S p e c --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. In accordance with the copyright of that document, you can freely --
-- copy and modify this specification, provided that if you redistribute a --
-- modified version, any changes that you have made are clearly indicated. --
-- --
------------------------------------------------------------------------------
-- In Ada 95, the package Ada.Text_IO.Fixed_IO is a subpackage of Text_IO.
-- This is for compatibility with Ada 83. In GNAT we make it a child package
-- to avoid loading the necessary code if Fixed_IO is not instantiated. See
-- routine Rtsfind.Check_Text_IO_Special_Unit for a description of how we
-- patch up the difference in semantics so that it is invisible to the Ada
-- programmer.
private generic
type Num is delta <>;
package Ada.Text_IO.Fixed_IO is
Default_Fore : Field := Num'Fore;
Default_Aft : Field := Num'Aft;
Default_Exp : Field := 0;
procedure Get
(File : File_Type;
Item : out Num;
Width : Field := 0);
procedure Get
(Item : out Num;
Width : Field := 0);
procedure Put
(File : File_Type;
Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp);
procedure Put
(Item : Num;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp);
procedure Get
(From : String;
Item : out Num;
Last : out Positive);
procedure Put
(To : out String;
Item : Num;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp);
private
pragma Inline (Get);
pragma Inline (Put);
end Ada.Text_IO.Fixed_IO;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Elements;
with AMF.Internals.Element_Collections;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.UML_Attributes;
with AMF.Visitors.UML_Iterators;
with AMF.Visitors.UML_Visitors;
with League.Strings.Internals;
with Matreshka.Internals.Strings;
package body AMF.Internals.UML_Add_Variable_Value_Actions is
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Enter_Add_Variable_Value_Action
(AMF.UML.Add_Variable_Value_Actions.UML_Add_Variable_Value_Action_Access (Self),
Control);
end if;
end Enter_Element;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Leave_Add_Variable_Value_Action
(AMF.UML.Add_Variable_Value_Actions.UML_Add_Variable_Value_Action_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Iterator in AMF.Visitors.UML_Iterators.UML_Iterator'Class then
AMF.Visitors.UML_Iterators.UML_Iterator'Class
(Iterator).Visit_Add_Variable_Value_Action
(Visitor,
AMF.UML.Add_Variable_Value_Actions.UML_Add_Variable_Value_Action_Access (Self),
Control);
end if;
end Visit_Element;
-------------------
-- Get_Insert_At --
-------------------
overriding function Get_Insert_At
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Input_Pins.UML_Input_Pin_Access is
begin
return
AMF.UML.Input_Pins.UML_Input_Pin_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Insert_At
(Self.Element)));
end Get_Insert_At;
-------------------
-- Set_Insert_At --
-------------------
overriding procedure Set_Insert_At
(Self : not null access UML_Add_Variable_Value_Action_Proxy;
To : AMF.UML.Input_Pins.UML_Input_Pin_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Insert_At
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Insert_At;
------------------------
-- Get_Is_Replace_All --
------------------------
overriding function Get_Is_Replace_All
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Replace_All
(Self.Element);
end Get_Is_Replace_All;
------------------------
-- Set_Is_Replace_All --
------------------------
overriding procedure Set_Is_Replace_All
(Self : not null access UML_Add_Variable_Value_Action_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Replace_All
(Self.Element, To);
end Set_Is_Replace_All;
---------------
-- Get_Value --
---------------
overriding function Get_Value
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Input_Pins.UML_Input_Pin_Access is
begin
return
AMF.UML.Input_Pins.UML_Input_Pin_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Value
(Self.Element)));
end Get_Value;
---------------
-- Set_Value --
---------------
overriding procedure Set_Value
(Self : not null access UML_Add_Variable_Value_Action_Proxy;
To : AMF.UML.Input_Pins.UML_Input_Pin_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Value
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Value;
------------------
-- Get_Variable --
------------------
overriding function Get_Variable
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Variables.UML_Variable_Access is
begin
return
AMF.UML.Variables.UML_Variable_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Variable
(Self.Element)));
end Get_Variable;
------------------
-- Set_Variable --
------------------
overriding procedure Set_Variable
(Self : not null access UML_Add_Variable_Value_Action_Proxy;
To : AMF.UML.Variables.UML_Variable_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Variable
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Variable;
-----------------
-- Get_Context --
-----------------
overriding function Get_Context
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Classifiers.UML_Classifier_Access is
begin
return
AMF.UML.Classifiers.UML_Classifier_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Context
(Self.Element)));
end Get_Context;
---------------
-- Get_Input --
---------------
overriding function Get_Input
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Input_Pins.Collections.Ordered_Set_Of_UML_Input_Pin is
begin
return
AMF.UML.Input_Pins.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Input
(Self.Element)));
end Get_Input;
------------------------------
-- Get_Is_Locally_Reentrant --
------------------------------
overriding function Get_Is_Locally_Reentrant
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Locally_Reentrant
(Self.Element);
end Get_Is_Locally_Reentrant;
------------------------------
-- Set_Is_Locally_Reentrant --
------------------------------
overriding procedure Set_Is_Locally_Reentrant
(Self : not null access UML_Add_Variable_Value_Action_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Locally_Reentrant
(Self.Element, To);
end Set_Is_Locally_Reentrant;
-----------------------------
-- Get_Local_Postcondition --
-----------------------------
overriding function Get_Local_Postcondition
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint is
begin
return
AMF.UML.Constraints.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Local_Postcondition
(Self.Element)));
end Get_Local_Postcondition;
----------------------------
-- Get_Local_Precondition --
----------------------------
overriding function Get_Local_Precondition
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint is
begin
return
AMF.UML.Constraints.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Local_Precondition
(Self.Element)));
end Get_Local_Precondition;
----------------
-- Get_Output --
----------------
overriding function Get_Output
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Output_Pins.Collections.Ordered_Set_Of_UML_Output_Pin is
begin
return
AMF.UML.Output_Pins.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Output
(Self.Element)));
end Get_Output;
-----------------
-- Get_Handler --
-----------------
overriding function Get_Handler
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Exception_Handlers.Collections.Set_Of_UML_Exception_Handler is
begin
return
AMF.UML.Exception_Handlers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Handler
(Self.Element)));
end Get_Handler;
------------------
-- Get_Activity --
------------------
overriding function Get_Activity
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Activities.UML_Activity_Access is
begin
return
AMF.UML.Activities.UML_Activity_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Activity
(Self.Element)));
end Get_Activity;
------------------
-- Set_Activity --
------------------
overriding procedure Set_Activity
(Self : not null access UML_Add_Variable_Value_Action_Proxy;
To : AMF.UML.Activities.UML_Activity_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Activity
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Activity;
------------------
-- Get_In_Group --
------------------
overriding function Get_In_Group
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Activity_Groups.Collections.Set_Of_UML_Activity_Group is
begin
return
AMF.UML.Activity_Groups.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Group
(Self.Element)));
end Get_In_Group;
---------------------------------
-- Get_In_Interruptible_Region --
---------------------------------
overriding function Get_In_Interruptible_Region
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Interruptible_Activity_Regions.Collections.Set_Of_UML_Interruptible_Activity_Region is
begin
return
AMF.UML.Interruptible_Activity_Regions.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Interruptible_Region
(Self.Element)));
end Get_In_Interruptible_Region;
----------------------
-- Get_In_Partition --
----------------------
overriding function Get_In_Partition
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Activity_Partitions.Collections.Set_Of_UML_Activity_Partition is
begin
return
AMF.UML.Activity_Partitions.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Partition
(Self.Element)));
end Get_In_Partition;
----------------------------
-- Get_In_Structured_Node --
----------------------------
overriding function Get_In_Structured_Node
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access is
begin
return
AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Structured_Node
(Self.Element)));
end Get_In_Structured_Node;
----------------------------
-- Set_In_Structured_Node --
----------------------------
overriding procedure Set_In_Structured_Node
(Self : not null access UML_Add_Variable_Value_Action_Proxy;
To : AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_In_Structured_Node
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_In_Structured_Node;
------------------
-- Get_Incoming --
------------------
overriding function Get_Incoming
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge is
begin
return
AMF.UML.Activity_Edges.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Incoming
(Self.Element)));
end Get_Incoming;
------------------
-- Get_Outgoing --
------------------
overriding function Get_Outgoing
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge is
begin
return
AMF.UML.Activity_Edges.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Outgoing
(Self.Element)));
end Get_Outgoing;
------------------------
-- Get_Redefined_Node --
------------------------
overriding function Get_Redefined_Node
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Activity_Nodes.Collections.Set_Of_UML_Activity_Node is
begin
return
AMF.UML.Activity_Nodes.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Node
(Self.Element)));
end Get_Redefined_Node;
-----------------
-- Get_Is_Leaf --
-----------------
overriding function Get_Is_Leaf
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Leaf
(Self.Element);
end Get_Is_Leaf;
-----------------
-- Set_Is_Leaf --
-----------------
overriding procedure Set_Is_Leaf
(Self : not null access UML_Add_Variable_Value_Action_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Leaf
(Self.Element, To);
end Set_Is_Leaf;
---------------------------
-- Get_Redefined_Element --
---------------------------
overriding function Get_Redefined_Element
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element is
begin
return
AMF.UML.Redefinable_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Element
(Self.Element)));
end Get_Redefined_Element;
------------------------------
-- Get_Redefinition_Context --
------------------------------
overriding function Get_Redefinition_Context
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
return
AMF.UML.Classifiers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefinition_Context
(Self.Element)));
end Get_Redefinition_Context;
---------------------------
-- Get_Client_Dependency --
---------------------------
overriding function Get_Client_Dependency
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency is
begin
return
AMF.UML.Dependencies.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Client_Dependency
(Self.Element)));
end Get_Client_Dependency;
-------------------------
-- Get_Name_Expression --
-------------------------
overriding function Get_Name_Expression
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access is
begin
return
AMF.UML.String_Expressions.UML_String_Expression_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Name_Expression
(Self.Element)));
end Get_Name_Expression;
-------------------------
-- Set_Name_Expression --
-------------------------
overriding procedure Set_Name_Expression
(Self : not null access UML_Add_Variable_Value_Action_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Name_Expression
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Name_Expression;
-------------------
-- Get_Namespace --
-------------------
overriding function Get_Namespace
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
return
AMF.UML.Namespaces.UML_Namespace_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Namespace
(Self.Element)));
end Get_Namespace;
------------------------
-- Get_Qualified_Name --
------------------------
overriding function Get_Qualified_Name
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.Optional_String is
begin
declare
use type Matreshka.Internals.Strings.Shared_String_Access;
Aux : constant Matreshka.Internals.Strings.Shared_String_Access
:= AMF.Internals.Tables.UML_Attributes.Internal_Get_Qualified_Name (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end;
end Get_Qualified_Name;
-------------
-- Context --
-------------
overriding function Context
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Classifiers.UML_Classifier_Access is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Context unimplemented");
raise Program_Error with "Unimplemented procedure UML_Add_Variable_Value_Action_Proxy.Context";
return Context (Self);
end Context;
------------------------
-- Is_Consistent_With --
------------------------
overriding function Is_Consistent_With
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy;
Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Consistent_With unimplemented");
raise Program_Error with "Unimplemented procedure UML_Add_Variable_Value_Action_Proxy.Is_Consistent_With";
return Is_Consistent_With (Self, Redefinee);
end Is_Consistent_With;
-----------------------------------
-- Is_Redefinition_Context_Valid --
-----------------------------------
overriding function Is_Redefinition_Context_Valid
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy;
Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Redefinition_Context_Valid unimplemented");
raise Program_Error with "Unimplemented procedure UML_Add_Variable_Value_Action_Proxy.Is_Redefinition_Context_Valid";
return Is_Redefinition_Context_Valid (Self, Redefined);
end Is_Redefinition_Context_Valid;
-------------------------
-- All_Owning_Packages --
-------------------------
overriding function All_Owning_Packages
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "All_Owning_Packages unimplemented");
raise Program_Error with "Unimplemented procedure UML_Add_Variable_Value_Action_Proxy.All_Owning_Packages";
return All_Owning_Packages (Self);
end All_Owning_Packages;
-----------------------------
-- Is_Distinguishable_From --
-----------------------------
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Distinguishable_From unimplemented");
raise Program_Error with "Unimplemented procedure UML_Add_Variable_Value_Action_Proxy.Is_Distinguishable_From";
return Is_Distinguishable_From (Self, N, Ns);
end Is_Distinguishable_From;
---------------
-- Namespace --
---------------
overriding function Namespace
(Self : not null access constant UML_Add_Variable_Value_Action_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Namespace unimplemented");
raise Program_Error with "Unimplemented procedure UML_Add_Variable_Value_Action_Proxy.Namespace";
return Namespace (Self);
end Namespace;
end AMF.Internals.UML_Add_Variable_Value_Actions;
|
with
openGL.Geometry.textured,
openGL.Primitive.indexed;
package body openGL.Model.box.textured
is
type Geometry_view is access all Geometry.textured.item'Class;
---------
--- Forge
--
function new_Box (Size : in Vector_3;
Faces : in textured.Faces;
is_Skybox : in Boolean := False) return View
is
Self : constant View := new Item;
begin
Self.Faces := Faces;
Self.is_Skybox := is_Skybox;
Self.Size := Size;
return Self;
end new_Box;
--------------
--- Attributes
--
overriding
function to_GL_Geometries (Self : access Item; Textures : access Texture.name_Map_of_texture'Class;
Fonts : in Font.font_id_Map_of_font) return Geometry.views
is
pragma unreferenced (Fonts);
use Geometry.textured,
Texture;
the_Sites : constant box.Sites := Self.vertex_Sites;
the_Indices : aliased Indices := (1, 2, 3, 4);
function new_Face (Vertices : access Geometry.textured.Vertex_array) return Geometry_view
is
use Primitive;
the_Geometry : constant Geometry_view := Geometry.textured.new_Geometry;
the_Primitive : constant Primitive.view := Primitive.indexed.new_Primitive (triangle_Fan,
the_Indices).all'Access;
begin
the_Geometry.Vertices_are (Vertices.all);
the_Geometry.add (the_Primitive);
return the_Geometry;
end new_Face;
front_Face : Geometry_view;
rear_Face : Geometry_view;
upper_Face : Geometry_view;
lower_Face : Geometry_view;
left_Face : Geometry_view;
right_Face : Geometry_view;
begin
if Self.is_Skybox
then
the_Indices := (4, 3, 2, 1);
end if;
-- Front
--
declare
the_Vertices : aliased Geometry.textured.Vertex_array
:= (1 => (Site => the_Sites ( left_lower_front), Coords => (0.0, 0.0)),
2 => (Site => the_Sites (right_lower_front), Coords => (1.0, 0.0)),
3 => (Site => the_Sites (right_upper_front), Coords => (1.0, 1.0)),
4 => (Site => the_Sites ( left_upper_front), Coords => (0.0, 1.0)));
begin
front_Face := new_Face (Vertices => the_Vertices'Access);
if Self.Faces (Front).texture_Name /= null_Asset
then
front_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
front_Face.is_Transparent (now => front_Face.Texture.is_Transparent);
end if;
end;
-- Rear
--
declare
the_Vertices : aliased Geometry.textured.Vertex_array
:= (1 => (Site => the_Sites (Right_Lower_Rear), Coords => (0.0, 0.0)),
2 => (Site => the_Sites ( Left_Lower_Rear), Coords => (1.0, 0.0)),
3 => (Site => the_Sites ( Left_Upper_Rear), Coords => (1.0, 1.0)),
4 => (Site => the_Sites (Right_Upper_Rear), Coords => (0.0, 1.0)));
begin
rear_Face := new_Face (Vertices => the_Vertices'Access);
if Self.Faces (Rear).texture_Name /= null_Asset
then
rear_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
rear_Face.is_Transparent (now => rear_Face.Texture.is_Transparent);
end if;
end;
-- Upper
--
declare
the_Vertices : aliased Geometry.textured.Vertex_array
:= (1 => (Site => the_Sites ( Left_Upper_Front), Coords => (0.0, 0.0)),
2 => (Site => the_Sites (Right_Upper_Front), Coords => (1.0, 0.0)),
3 => (Site => the_Sites (Right_Upper_Rear), Coords => (1.0, 1.0)),
4 => (Site => the_Sites ( Left_Upper_Rear), Coords => (0.0, 1.0)));
begin
upper_Face := new_Face (Vertices => the_Vertices'Access);
if Self.Faces (Upper).texture_Name /= null_Asset
then
upper_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
upper_Face.is_Transparent (now => upper_Face.Texture.is_Transparent);
end if;
end;
-- Lower
--
declare
the_Vertices : aliased Geometry.textured.Vertex_array
:= (1 => (Site => the_Sites (Right_Lower_Front), Coords => (0.0, 0.0)),
2 => (Site => the_Sites ( Left_Lower_Front), Coords => (1.0, 0.0)),
3 => (Site => the_Sites ( Left_Lower_Rear), Coords => (1.0, 1.0)),
4 => (Site => the_Sites (Right_Lower_Rear), Coords => (0.0, 1.0)));
begin
lower_Face := new_Face (Vertices => the_Vertices'Access);
if Self.Faces (Lower).texture_Name /= null_Asset
then
lower_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
lower_Face.is_Transparent (now => lower_Face.Texture.is_Transparent);
end if;
end;
-- Left
--
declare
the_Vertices : aliased Geometry.textured.Vertex_array
:= (1 => (Site => the_Sites (Left_Lower_Rear), Coords => (0.0, 0.0)),
2 => (Site => the_Sites (Left_Lower_Front), Coords => (1.0, 0.0)),
3 => (Site => the_Sites (Left_Upper_Front), Coords => (1.0, 1.0)),
4 => (Site => the_Sites (Left_Upper_Rear), Coords => (0.0, 1.0)));
begin
left_Face := new_Face (Vertices => the_Vertices'Access);
if Self.Faces (Left).texture_Name /= null_Asset
then
left_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
left_Face.is_Transparent (now => left_Face.Texture.is_Transparent);
end if;
end;
-- Right
--
declare
the_Vertices : aliased Geometry.textured.Vertex_array
:= (1 => (Site => the_Sites (Right_Lower_Front), Coords => (0.0, 0.0)),
2 => (Site => the_Sites (Right_Lower_Rear), Coords => (1.0, 0.0)),
3 => (Site => the_Sites (Right_Upper_Rear), Coords => (1.0, 1.0)),
4 => (Site => the_Sites (Right_Upper_Front), Coords => (0.0, 1.0)));
begin
right_Face := new_Face (Vertices => the_Vertices'Access);
if Self.Faces (Right).texture_Name /= null_Asset
then
right_Face.Texture_is (Textures.fetch (Self.Faces (Front).texture_Name));
right_Face.is_Transparent (now => right_Face.Texture.is_Transparent);
end if;
end;
return (1 => front_Face.all'Access,
2 => rear_Face.all'Access,
3 => upper_Face.all'Access,
4 => lower_Face.all'Access,
5 => left_Face.all'Access,
6 => right_Face.all'Access);
end to_GL_Geometries;
end openGL.Model.box.textured;
|
--
-- Copyright 2018 The wookey project team <wookey@ssi.gouv.fr>
-- - Ryad Benadjila
-- - Arnauld Michelizza
-- - Mathieu Renard
-- - Philippe Thierry
-- - Philippe Trebuchet
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
--
with ewok.tasks_shared; use ewok.tasks_shared;
with soc.dma.interfaces;
with types.c;
package ewok.exported.dma
with spark_mode => on
is
-- Specify DMA elements to (re)configure
type t_config_mask is new soc.dma.interfaces.t_config_mask;
--
-- User defined DMA configuration
--
type t_controller is new soc.dma.t_dma_periph_index with size => 8;
subtype t_stream is unsigned_8 range 0 .. 7;
subtype t_channel is unsigned_8 range 0 .. 7;
type t_dma_user_config is record
controller : t_controller := ID_DMA1;
stream : t_stream := 0;
channel : t_channel := 0;
size : unsigned_16; -- size in bytes
in_addr : system_address;
in_priority : soc.dma.interfaces.t_priority_level;
in_handler : system_address; -- ISR
out_addr : system_address;
out_priority : soc.dma.interfaces.t_priority_level;
out_handler : system_address; -- ISR
flow_controller : soc.dma.interfaces.t_flow_controller;
transfer_dir : soc.dma.interfaces.t_transfer_dir;
mode : soc.dma.interfaces.t_mode;
data_size : soc.dma.interfaces.t_data_size;
memory_inc : types.c.bool;
periph_inc : types.c.bool;
mem_burst_size : soc.dma.interfaces.t_burst_size;
periph_burst_size : soc.dma.interfaces.t_burst_size;
end record;
type t_dma_user_config_access is access t_dma_user_config;
type t_dma_shm_access is (SHM_ACCESS_READ, SHM_ACCESS_WRITE);
-- The caller (accessed_id) grant access to another task (granted_id)
-- to a range in its inner memory space. That mechanism permits to the
-- 'granted' to configure the DMA with an address that belongs to
-- the 'accessed' task.
type t_dma_shm_info is record
granted_id : t_task_id := ID_UNUSED;
accessed_id : t_task_id := ID_UNUSED; -- caller
base : system_address := 0;
size : unsigned_32 := 0;
access_type : t_dma_shm_access := SHM_ACCESS_READ;
end record;
end ewok.exported.dma;
|
-- { dg-do run }
with System.Storage_Elements; use System.Storage_Elements;
with Ada.Unchecked_Deallocation;
procedure Align_MAX is
Align : constant := Standard'Maximum_Alignment;
generic
type Data_Type (<>) is private;
type Access_Type is access Data_Type;
with function Allocate return Access_Type;
with function Address (Ptr : Access_Type) return System.Address;
package Check is
-- The hooks below just force asm generation that helps associating
-- obscure nested function names with their package instance name.
Hook_Allocate : System.Address := Allocate'Address;
Hook_Address : System.Address := Address'Address;
pragma Volatile (Hook_Allocate);
pragma Volatile (Hook_Address);
procedure Run (Announce : String);
end;
package body Check is
procedure Free is new
Ada.Unchecked_Deallocation (Data_Type, Access_Type);
procedure Run (Announce : String) is
Addr : System.Address;
Blocks : array (1 .. 1024) of Access_Type;
begin
for J in Blocks'Range loop
Blocks (J) := Allocate;
Addr := Address (Blocks (J));
if Addr mod Data_Type'Alignment /= 0 then
raise Program_Error;
end if;
end loop;
for J in Blocks'Range loop
Free (Blocks (J));
end loop;
end;
end;
begin
declare
type Array_Type is array (Integer range <>) of Integer;
for Array_Type'Alignment use Align;
type FAT_Array_Access is access all Array_Type;
function Allocate return FAT_Array_Access is
begin
return new Array_Type (1 .. 1);
end;
function Address (Ptr : FAT_Array_Access) return System.Address is
begin
return Ptr(1)'Address;
end;
package Check_FAT is new
Check (Array_Type, FAT_Array_Access, Allocate, Address);
begin
Check_FAT.Run ("Checking FAT pointer to UNC array");
end;
declare
type Array_Type is array (Integer range <>) of Integer;
for Array_Type'Alignment use Align;
type THIN_Array_Access is access all Array_Type;
for THIN_Array_Access'Size use Standard'Address_Size;
function Allocate return THIN_Array_Access is
begin
return new Array_Type (1 .. 1);
end;
function Address (Ptr : THIN_Array_Access) return System.Address is
begin
return Ptr(1)'Address;
end;
package Check_THIN is new
Check (Array_Type, THIN_Array_Access, Allocate, Address);
begin
Check_THIN.Run ("Checking THIN pointer to UNC array");
end;
declare
type Array_Type is array (Integer range 1 .. 1) of Integer;
for Array_Type'Alignment use Align;
type Array_Access is access all Array_Type;
function Allocate return Array_Access is
begin
return new Array_Type;
end;
function Address (Ptr : Array_Access) return System.Address is
begin
return Ptr(1)'Address;
end;
package Check_Array is new
Check (Array_Type, Array_Access, Allocate, Address);
begin
Check_Array.Run ("Checking pointer to constrained array");
end;
declare
type Record_Type is record
Value : Integer;
end record;
for Record_Type'Alignment use Align;
type Record_Access is access all Record_Type;
function Allocate return Record_Access is
begin
return new Record_Type;
end;
function Address (Ptr : Record_Access) return System.Address is
begin
return Ptr.all'Address;
end;
package Check_Record is new
Check (Record_Type, Record_Access, Allocate, Address);
begin
Check_Record.Run ("Checking pointer to record");
end;
end;
|
-- Hyperion API
-- Hyperion Monitoring API The monitoring agent is first registered so that the server knows it as well as its security key. Each host are then registered by a monitoring agent.
--
-- The version of the OpenAPI document: 1.0.0
-- Contact: Stephane.Carrez@gmail.com
--
-- NOTE: This package is auto generated by OpenAPI-Generator 4.1.0-SNAPSHOT.
-- https://openapi-generator.tech
-- Do not edit the class manually.
with Swagger.Streams;
package body Helios.Rest.Clients is
-- Register a monitoring agent
-- Register a new monitoring agent in the system
procedure Register_Agent
(Client : in out Client_Type;
Name : in Swagger.UString;
Ip : in Swagger.UString;
Agent_Key : in Swagger.UString;
Result : out Helios.Rest.Models.Agent_Type) is
URI : Swagger.Clients.URI_Type;
Req : Swagger.Clients.Request_Type;
Reply : Swagger.Value_Type;
begin
Client.Set_Accept ((1 => Swagger.Clients.APPLICATION_JSON));
Client.Initialize (Req, (1 => Swagger.Clients.APPLICATION_FORM));
Req.Stream.Write_Entity ("name", Name);
Req.Stream.Write_Entity ("ip", Ip);
Req.Stream.Write_Entity ("agentKey", Agent_Key);
URI.Set_Path ("/agents");
Client.Call (Swagger.Clients.POST, URI, Req, Reply);
Helios.Rest.Models.Deserialize (Reply, "", Result);
end Register_Agent;
-- Create a host
-- Register a new host in the monitoring system
procedure Create_Host
(Client : in out Client_Type;
Name : in Swagger.UString;
Ip : in Swagger.UString;
Host_Key : in Swagger.UString;
Agent_Key : in Swagger.UString;
Agent_Id : in Integer;
Result : out Helios.Rest.Models.Host_Type) is
URI : Swagger.Clients.URI_Type;
Req : Swagger.Clients.Request_Type;
Reply : Swagger.Value_Type;
begin
Client.Set_Accept ((1 => Swagger.Clients.APPLICATION_JSON));
Client.Initialize (Req, (1 => Swagger.Clients.APPLICATION_FORM));
Req.Stream.Write_Entity ("name", Name);
Req.Stream.Write_Entity ("ip", Ip);
Req.Stream.Write_Entity ("hostKey", Host_Key);
Req.Stream.Write_Entity ("agentKey", Agent_Key);
Req.Stream.Write_Entity ("agentId", Agent_Id);
URI.Set_Path ("/hosts");
Client.Call (Swagger.Clients.POST, URI, Req, Reply);
Helios.Rest.Models.Deserialize (Reply, "", Result);
end Create_Host;
end Helios.Rest.Clients;
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="14">
<syndb class_id="0" tracking_level="0" version="0">
<userIPLatency>-1</userIPLatency>
<userIPName/>
<cdfg class_id="1" tracking_level="1" version="0" object_id="_0">
<name>call_Loop_LB2D_shift</name>
<ret_bitwidth>0</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="3" tracking_level="1" version="0" object_id="_1">
<Value class_id="4" tracking_level="0" version="0">
<Obj class_id="5" tracking_level="0" version="0">
<type>1</type>
<id>1</id>
<name>slice_stream_V_value_V</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo class_id="6" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>in_stream.V.value.V</originalName>
<rtlName/>
<coreName>FIFO_SRL</coreName>
</Obj>
<bitwidth>96</bitwidth>
</Value>
<direction>0</direction>
<if_type>3</if_type>
<array_size>0</array_size>
<bit_vecs class_id="7" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_2">
<Value>
<Obj>
<type>1</type>
<id>2</id>
<name>out_stream_V_value_V</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>out_stream.V.value.V</originalName>
<rtlName/>
<coreName>FIFO_SRL</coreName>
</Obj>
<bitwidth>288</bitwidth>
</Value>
<direction>1</direction>
<if_type>3</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
</ports>
<nodes class_id="8" tracking_level="0" version="0">
<count>36</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_3">
<Value>
<Obj>
<type>0</type>
<id>3</id>
<name>buffer_1_value_V</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>buffer[1].value.V</originalName>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>96</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>62</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_4">
<Value>
<Obj>
<type>0</type>
<id>4</id>
<name>buffer_0_value_V</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>buffer[0].value.V</originalName>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>96</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>63</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_5">
<Value>
<Obj>
<type>0</type>
<id>9</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>64</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_6">
<Value>
<Obj>
<type>0</type>
<id>11</id>
<name>n1</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>n1</originalName>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>11</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>65</item>
<item>66</item>
<item>68</item>
<item>69</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_7">
<Value>
<Obj>
<type>0</type>
<id>12</id>
<name>tmp_5</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>216</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="11" tracking_level="0" version="0">
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second class_id="12" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="13" tracking_level="0" version="0">
<first class_id="14" tracking_level="0" version="0">
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>216</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_5_fu_115_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>70</item>
<item>72</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_8">
<Value>
<Obj>
<type>0</type>
<id>14</id>
<name>n1_1</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>216</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>216</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>n1</originalName>
<rtlName>n1_1_fu_121_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>11</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>73</item>
<item>75</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_9">
<Value>
<Obj>
<type>0</type>
<id>15</id>
<name/>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>216</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>216</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>76</item>
<item>77</item>
<item>78</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_10">
<Value>
<Obj>
<type>0</type>
<id>19</id>
<name/>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>32</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>92</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_11">
<Value>
<Obj>
<type>0</type>
<id>21</id>
<name>i_0_i_i</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>i</originalName>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>11</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>80</item>
<item>81</item>
<item>82</item>
<item>83</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_12">
<Value>
<Obj>
<type>0</type>
<id>22</id>
<name>tmp_7</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>32</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_7_fu_127_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>84</item>
<item>86</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_13">
<Value>
<Obj>
<type>0</type>
<id>24</id>
<name>i</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>32</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>i</originalName>
<rtlName>i_fu_133_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>11</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>87</item>
<item>88</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_14">
<Value>
<Obj>
<type>0</type>
<id>25</id>
<name/>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>32</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>89</item>
<item>90</item>
<item>91</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_15">
<Value>
<Obj>
<type>0</type>
<id>30</id>
<name>tmp_value_V_1</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>40</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>40</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>tmp.value.V</originalName>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>96</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>100</item>
<item>101</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>31</id>
<name>tmp</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>42</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>42</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_fu_139_p4</rtlName>
<coreName/>
</Obj>
<bitwidth>10</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>103</item>
<item>104</item>
<item>105</item>
<item>107</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_17">
<Value>
<Obj>
<type>0</type>
<id>32</id>
<name>icmp</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>42</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>42</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>icmp_fu_149_p2</rtlName>
<coreName/>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>108</item>
<item>110</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_18">
<Value>
<Obj>
<type>0</type>
<id>33</id>
<name/>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>42</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>42</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>111</item>
<item>112</item>
<item>113</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_19">
<Value>
<Obj>
<type>0</type>
<id>35</id>
<name>buffer_1_value_V_lo_1</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>50</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>50</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>96</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>114</item>
</oprand_edges>
<opcode>load</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_20">
<Value>
<Obj>
<type>0</type>
<id>36</id>
<name>buffer_0_value_V_lo</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>50</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>50</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>96</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>115</item>
</oprand_edges>
<opcode>load</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_21">
<Value>
<Obj>
<type>0</type>
<id>37</id>
<name>tmp_1</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>50</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>50</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_1_fu_161_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>116</item>
</oprand_edges>
<opcode>trunc</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_22">
<Value>
<Obj>
<type>0</type>
<id>38</id>
<name>tmp_2</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>50</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>50</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_2_fu_165_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>117</item>
</oprand_edges>
<opcode>trunc</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_23">
<Value>
<Obj>
<type>0</type>
<id>39</id>
<name>tmp_4</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>50</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>50</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>tmp_4_fu_169_p1</rtlName>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>118</item>
</oprand_edges>
<opcode>trunc</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_24">
<Value>
<Obj>
<type>0</type>
<id>40</id>
<name>p_Result_20_1</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>50</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>50</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>p_Result_20_1_fu_173_p4</rtlName>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>120</item>
<item>121</item>
<item>123</item>
<item>125</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_25">
<Value>
<Obj>
<type>0</type>
<id>41</id>
<name>p_Result_20_1_1</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>50</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>50</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>p_Result_20_1_1_fu_183_p4</rtlName>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>126</item>
<item>127</item>
<item>128</item>
<item>129</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_26">
<Value>
<Obj>
<type>0</type>
<id>42</id>
<name>p_Result_20_1_2</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>50</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>50</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>p_Result_20_1_2_fu_193_p4</rtlName>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>130</item>
<item>131</item>
<item>132</item>
<item>133</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_27">
<Value>
<Obj>
<type>0</type>
<id>43</id>
<name>p_Result_20_2</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>50</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>50</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>p_Result_20_2_fu_203_p4</rtlName>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>134</item>
<item>135</item>
<item>137</item>
<item>139</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_28">
<Value>
<Obj>
<type>0</type>
<id>44</id>
<name>p_Result_20_2_1</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>50</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>50</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>p_Result_20_2_1_fu_213_p4</rtlName>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>140</item>
<item>141</item>
<item>142</item>
<item>143</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_29">
<Value>
<Obj>
<type>0</type>
<id>45</id>
<name>p_Result_20_2_2</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>50</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>50</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName>p_Result_20_2_2_fu_223_p4</rtlName>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>144</item>
<item>145</item>
<item>146</item>
<item>147</item>
</oprand_edges>
<opcode>partselect</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_30">
<Value>
<Obj>
<type>0</type>
<id>46</id>
<name>tmp_value_V</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>50</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>50</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>tmp.value.V</originalName>
<rtlName>out_stream_V_value_V_din</rtlName>
<coreName/>
</Obj>
<bitwidth>288</bitwidth>
</Value>
<oprand_edges>
<count>10</count>
<item_version>0</item_version>
<item>149</item>
<item>150</item>
<item>151</item>
<item>152</item>
<item>153</item>
<item>154</item>
<item>155</item>
<item>156</item>
<item>157</item>
<item>158</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_31">
<Value>
<Obj>
<type>0</type>
<id>47</id>
<name/>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>52</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>52</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>160</item>
<item>161</item>
<item>162</item>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_32">
<Value>
<Obj>
<type>0</type>
<id>48</id>
<name/>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>53</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>53</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>163</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_33">
<Value>
<Obj>
<type>0</type>
<id>50</id>
<name>buffer_1_value_V_lo</name>
<fileName>../../../lib_files/Stencil.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>75</lineNumber>
<contextFuncName>operator=</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>37</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
<item>
<first>
<first>../../../lib_files/Stencil.h</first>
<second>operator=</second>
</first>
<second>75</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>96</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>93</item>
</oprand_edges>
<opcode>load</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_34">
<Value>
<Obj>
<type>0</type>
<id>52</id>
<name/>
<fileName>../../../lib_files/Stencil.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>75</lineNumber>
<contextFuncName>operator=</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>37</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
<item>
<first>
<first>../../../lib_files/Stencil.h</first>
<second>operator=</second>
</first>
<second>75</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>94</item>
<item>95</item>
<item>279</item>
</oprand_edges>
<opcode>store</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_35">
<Value>
<Obj>
<type>0</type>
<id>53</id>
<name/>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>40</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>40</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>96</item>
<item>97</item>
<item>277</item>
<item>278</item>
</oprand_edges>
<opcode>store</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_36">
<Value>
<Obj>
<type>0</type>
<id>54</id>
<name/>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>32</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>32</second>
</item>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>linebuffer_1D&lt;1920, 3, 1, 1, 1, 3, unsigned int&gt;</second>
</first>
<second>143</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>98</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_37">
<Value>
<Obj>
<type>0</type>
<id>57</id>
<name/>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>216</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_32_real/conv2d</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>216</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>79</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_38">
<Value>
<Obj>
<type>0</type>
<id>59</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>0</count>
<item_version>0</item_version>
</oprand_edges>
<opcode>ret</opcode>
<m_Display>0</m_Display>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>11</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_39">
<Value>
<Obj>
<type>2</type>
<id>61</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_40">
<Value>
<Obj>
<type>2</type>
<id>67</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>11</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_41">
<Value>
<Obj>
<type>2</type>
<id>71</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>11</bitwidth>
</Value>
<const_type>0</const_type>
<content>1078</content>
</item>
<item class_id_reference="16" object_id="_42">
<Value>
<Obj>
<type>2</type>
<id>74</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>11</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_43">
<Value>
<Obj>
<type>2</type>
<id>85</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>11</bitwidth>
</Value>
<const_type>0</const_type>
<content>1920</content>
</item>
<item class_id_reference="16" object_id="_44">
<Value>
<Obj>
<type>2</type>
<id>106</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>10</content>
</item>
<item class_id_reference="16" object_id="_45">
<Value>
<Obj>
<type>2</type>
<id>109</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>10</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_46">
<Value>
<Obj>
<type>2</type>
<id>122</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>32</content>
</item>
<item class_id_reference="16" object_id="_47">
<Value>
<Obj>
<type>2</type>
<id>124</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>63</content>
</item>
<item class_id_reference="16" object_id="_48">
<Value>
<Obj>
<type>2</type>
<id>136</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>64</content>
</item>
<item class_id_reference="16" object_id="_49">
<Value>
<Obj>
<type>2</type>
<id>138</id>
<name>empty</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<const_type>0</const_type>
<content>95</content>
</item>
</consts>
<blocks class_id="17" tracking_level="0" version="0">
<count>9</count>
<item_version>0</item_version>
<item class_id="18" tracking_level="1" version="0" object_id="_50">
<Obj>
<type>3</type>
<id>10</id>
<name>newFuncRoot</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<node_objs>
<count>3</count>
<item_version>0</item_version>
<item>3</item>
<item>4</item>
<item>9</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_51">
<Obj>
<type>3</type>
<id>16</id>
<name>.preheader</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<node_objs>
<count>4</count>
<item_version>0</item_version>
<item>11</item>
<item>12</item>
<item>14</item>
<item>15</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_52">
<Obj>
<type>3</type>
<id>20</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>19</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_53">
<Obj>
<type>3</type>
<id>26</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<node_objs>
<count>4</count>
<item_version>0</item_version>
<item>21</item>
<item>22</item>
<item>24</item>
<item>25</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_54">
<Obj>
<type>3</type>
<id>34</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<node_objs>
<count>4</count>
<item_version>0</item_version>
<item>30</item>
<item>31</item>
<item>32</item>
<item>33</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_55">
<Obj>
<type>3</type>
<id>49</id>
<name>.preheader.i.i.preheader.0</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<node_objs>
<count>14</count>
<item_version>0</item_version>
<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>
</node_objs>
</item>
<item class_id_reference="18" object_id="_56">
<Obj>
<type>3</type>
<id>55</id>
<name>._crit_edge.i.i</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<node_objs>
<count>4</count>
<item_version>0</item_version>
<item>50</item>
<item>52</item>
<item>53</item>
<item>54</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_57">
<Obj>
<type>3</type>
<id>58</id>
<name>linebuffer_1D<1920ul, 3ul, 1ul, 1ul, 1ul, 3ul, unsigned int>.exit</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>57</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_58">
<Obj>
<type>3</type>
<id>60</id>
<name>.exitStub</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>59</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>91</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_59">
<id>62</id>
<edge_type>1</edge_type>
<source_obj>61</source_obj>
<sink_obj>3</sink_obj>
</item>
<item class_id_reference="20" object_id="_60">
<id>63</id>
<edge_type>1</edge_type>
<source_obj>61</source_obj>
<sink_obj>4</sink_obj>
</item>
<item class_id_reference="20" object_id="_61">
<id>64</id>
<edge_type>2</edge_type>
<source_obj>16</source_obj>
<sink_obj>9</sink_obj>
</item>
<item class_id_reference="20" object_id="_62">
<id>65</id>
<edge_type>1</edge_type>
<source_obj>14</source_obj>
<sink_obj>11</sink_obj>
</item>
<item class_id_reference="20" object_id="_63">
<id>66</id>
<edge_type>2</edge_type>
<source_obj>58</source_obj>
<sink_obj>11</sink_obj>
</item>
<item class_id_reference="20" object_id="_64">
<id>68</id>
<edge_type>1</edge_type>
<source_obj>67</source_obj>
<sink_obj>11</sink_obj>
</item>
<item class_id_reference="20" object_id="_65">
<id>69</id>
<edge_type>2</edge_type>
<source_obj>10</source_obj>
<sink_obj>11</sink_obj>
</item>
<item class_id_reference="20" object_id="_66">
<id>70</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>12</sink_obj>
</item>
<item class_id_reference="20" object_id="_67">
<id>72</id>
<edge_type>1</edge_type>
<source_obj>71</source_obj>
<sink_obj>12</sink_obj>
</item>
<item class_id_reference="20" object_id="_68">
<id>73</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>14</sink_obj>
</item>
<item class_id_reference="20" object_id="_69">
<id>75</id>
<edge_type>1</edge_type>
<source_obj>74</source_obj>
<sink_obj>14</sink_obj>
</item>
<item class_id_reference="20" object_id="_70">
<id>76</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>15</sink_obj>
</item>
<item class_id_reference="20" object_id="_71">
<id>77</id>
<edge_type>2</edge_type>
<source_obj>20</source_obj>
<sink_obj>15</sink_obj>
</item>
<item class_id_reference="20" object_id="_72">
<id>78</id>
<edge_type>2</edge_type>
<source_obj>60</source_obj>
<sink_obj>15</sink_obj>
</item>
<item class_id_reference="20" object_id="_73">
<id>79</id>
<edge_type>2</edge_type>
<source_obj>16</source_obj>
<sink_obj>57</sink_obj>
</item>
<item class_id_reference="20" object_id="_74">
<id>80</id>
<edge_type>1</edge_type>
<source_obj>67</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="20" object_id="_75">
<id>81</id>
<edge_type>2</edge_type>
<source_obj>20</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="20" object_id="_76">
<id>82</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="20" object_id="_77">
<id>83</id>
<edge_type>2</edge_type>
<source_obj>55</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="20" object_id="_78">
<id>84</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>22</sink_obj>
</item>
<item class_id_reference="20" object_id="_79">
<id>86</id>
<edge_type>1</edge_type>
<source_obj>85</source_obj>
<sink_obj>22</sink_obj>
</item>
<item class_id_reference="20" object_id="_80">
<id>87</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>24</sink_obj>
</item>
<item class_id_reference="20" object_id="_81">
<id>88</id>
<edge_type>1</edge_type>
<source_obj>74</source_obj>
<sink_obj>24</sink_obj>
</item>
<item class_id_reference="20" object_id="_82">
<id>89</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_83">
<id>90</id>
<edge_type>2</edge_type>
<source_obj>34</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_84">
<id>91</id>
<edge_type>2</edge_type>
<source_obj>58</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_85">
<id>92</id>
<edge_type>2</edge_type>
<source_obj>26</source_obj>
<sink_obj>19</sink_obj>
</item>
<item class_id_reference="20" object_id="_86">
<id>93</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>50</sink_obj>
</item>
<item class_id_reference="20" object_id="_87">
<id>94</id>
<edge_type>1</edge_type>
<source_obj>50</source_obj>
<sink_obj>52</sink_obj>
</item>
<item class_id_reference="20" object_id="_88">
<id>95</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>52</sink_obj>
</item>
<item class_id_reference="20" object_id="_89">
<id>96</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>53</sink_obj>
</item>
<item class_id_reference="20" object_id="_90">
<id>97</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>53</sink_obj>
</item>
<item class_id_reference="20" object_id="_91">
<id>98</id>
<edge_type>2</edge_type>
<source_obj>26</source_obj>
<sink_obj>54</sink_obj>
</item>
<item class_id_reference="20" object_id="_92">
<id>101</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="20" object_id="_93">
<id>104</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>31</sink_obj>
</item>
<item class_id_reference="20" object_id="_94">
<id>105</id>
<edge_type>1</edge_type>
<source_obj>61</source_obj>
<sink_obj>31</sink_obj>
</item>
<item class_id_reference="20" object_id="_95">
<id>107</id>
<edge_type>1</edge_type>
<source_obj>106</source_obj>
<sink_obj>31</sink_obj>
</item>
<item class_id_reference="20" object_id="_96">
<id>108</id>
<edge_type>1</edge_type>
<source_obj>31</source_obj>
<sink_obj>32</sink_obj>
</item>
<item class_id_reference="20" object_id="_97">
<id>110</id>
<edge_type>1</edge_type>
<source_obj>109</source_obj>
<sink_obj>32</sink_obj>
</item>
<item class_id_reference="20" object_id="_98">
<id>111</id>
<edge_type>1</edge_type>
<source_obj>32</source_obj>
<sink_obj>33</sink_obj>
</item>
<item class_id_reference="20" object_id="_99">
<id>112</id>
<edge_type>2</edge_type>
<source_obj>49</source_obj>
<sink_obj>33</sink_obj>
</item>
<item class_id_reference="20" object_id="_100">
<id>113</id>
<edge_type>2</edge_type>
<source_obj>55</source_obj>
<sink_obj>33</sink_obj>
</item>
<item class_id_reference="20" object_id="_101">
<id>114</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>35</sink_obj>
</item>
<item class_id_reference="20" object_id="_102">
<id>115</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>36</sink_obj>
</item>
<item class_id_reference="20" object_id="_103">
<id>116</id>
<edge_type>1</edge_type>
<source_obj>36</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_104">
<id>117</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>38</sink_obj>
</item>
<item class_id_reference="20" object_id="_105">
<id>118</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>39</sink_obj>
</item>
<item class_id_reference="20" object_id="_106">
<id>121</id>
<edge_type>1</edge_type>
<source_obj>36</source_obj>
<sink_obj>40</sink_obj>
</item>
<item class_id_reference="20" object_id="_107">
<id>123</id>
<edge_type>1</edge_type>
<source_obj>122</source_obj>
<sink_obj>40</sink_obj>
</item>
<item class_id_reference="20" object_id="_108">
<id>125</id>
<edge_type>1</edge_type>
<source_obj>124</source_obj>
<sink_obj>40</sink_obj>
</item>
<item class_id_reference="20" object_id="_109">
<id>127</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>41</sink_obj>
</item>
<item class_id_reference="20" object_id="_110">
<id>128</id>
<edge_type>1</edge_type>
<source_obj>122</source_obj>
<sink_obj>41</sink_obj>
</item>
<item class_id_reference="20" object_id="_111">
<id>129</id>
<edge_type>1</edge_type>
<source_obj>124</source_obj>
<sink_obj>41</sink_obj>
</item>
<item class_id_reference="20" object_id="_112">
<id>131</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>42</sink_obj>
</item>
<item class_id_reference="20" object_id="_113">
<id>132</id>
<edge_type>1</edge_type>
<source_obj>122</source_obj>
<sink_obj>42</sink_obj>
</item>
<item class_id_reference="20" object_id="_114">
<id>133</id>
<edge_type>1</edge_type>
<source_obj>124</source_obj>
<sink_obj>42</sink_obj>
</item>
<item class_id_reference="20" object_id="_115">
<id>135</id>
<edge_type>1</edge_type>
<source_obj>36</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_116">
<id>137</id>
<edge_type>1</edge_type>
<source_obj>136</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_117">
<id>139</id>
<edge_type>1</edge_type>
<source_obj>138</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_118">
<id>141</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>44</sink_obj>
</item>
<item class_id_reference="20" object_id="_119">
<id>142</id>
<edge_type>1</edge_type>
<source_obj>136</source_obj>
<sink_obj>44</sink_obj>
</item>
<item class_id_reference="20" object_id="_120">
<id>143</id>
<edge_type>1</edge_type>
<source_obj>138</source_obj>
<sink_obj>44</sink_obj>
</item>
<item class_id_reference="20" object_id="_121">
<id>145</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>45</sink_obj>
</item>
<item class_id_reference="20" object_id="_122">
<id>146</id>
<edge_type>1</edge_type>
<source_obj>136</source_obj>
<sink_obj>45</sink_obj>
</item>
<item class_id_reference="20" object_id="_123">
<id>147</id>
<edge_type>1</edge_type>
<source_obj>138</source_obj>
<sink_obj>45</sink_obj>
</item>
<item class_id_reference="20" object_id="_124">
<id>150</id>
<edge_type>1</edge_type>
<source_obj>45</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_125">
<id>151</id>
<edge_type>1</edge_type>
<source_obj>44</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_126">
<id>152</id>
<edge_type>1</edge_type>
<source_obj>43</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_127">
<id>153</id>
<edge_type>1</edge_type>
<source_obj>42</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_128">
<id>154</id>
<edge_type>1</edge_type>
<source_obj>41</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_129">
<id>155</id>
<edge_type>1</edge_type>
<source_obj>40</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_130">
<id>156</id>
<edge_type>1</edge_type>
<source_obj>39</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_131">
<id>157</id>
<edge_type>1</edge_type>
<source_obj>38</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_132">
<id>158</id>
<edge_type>1</edge_type>
<source_obj>37</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_133">
<id>161</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>47</sink_obj>
</item>
<item class_id_reference="20" object_id="_134">
<id>162</id>
<edge_type>1</edge_type>
<source_obj>46</source_obj>
<sink_obj>47</sink_obj>
</item>
<item class_id_reference="20" object_id="_135">
<id>163</id>
<edge_type>2</edge_type>
<source_obj>55</source_obj>
<sink_obj>48</sink_obj>
</item>
<item class_id_reference="20" object_id="_136">
<id>266</id>
<edge_type>2</edge_type>
<source_obj>10</source_obj>
<sink_obj>16</sink_obj>
</item>
<item class_id_reference="20" object_id="_137">
<id>267</id>
<edge_type>2</edge_type>
<source_obj>16</source_obj>
<sink_obj>60</sink_obj>
</item>
<item class_id_reference="20" object_id="_138">
<id>268</id>
<edge_type>2</edge_type>
<source_obj>16</source_obj>
<sink_obj>20</sink_obj>
</item>
<item class_id_reference="20" object_id="_139">
<id>269</id>
<edge_type>2</edge_type>
<source_obj>20</source_obj>
<sink_obj>26</sink_obj>
</item>
<item class_id_reference="20" object_id="_140">
<id>270</id>
<edge_type>2</edge_type>
<source_obj>26</source_obj>
<sink_obj>58</sink_obj>
</item>
<item class_id_reference="20" object_id="_141">
<id>271</id>
<edge_type>2</edge_type>
<source_obj>26</source_obj>
<sink_obj>34</sink_obj>
</item>
<item class_id_reference="20" object_id="_142">
<id>272</id>
<edge_type>2</edge_type>
<source_obj>34</source_obj>
<sink_obj>55</sink_obj>
</item>
<item class_id_reference="20" object_id="_143">
<id>273</id>
<edge_type>2</edge_type>
<source_obj>34</source_obj>
<sink_obj>49</sink_obj>
</item>
<item class_id_reference="20" object_id="_144">
<id>274</id>
<edge_type>2</edge_type>
<source_obj>49</source_obj>
<sink_obj>55</sink_obj>
</item>
<item class_id_reference="20" object_id="_145">
<id>275</id>
<edge_type>2</edge_type>
<source_obj>55</source_obj>
<sink_obj>26</sink_obj>
</item>
<item class_id_reference="20" object_id="_146">
<id>276</id>
<edge_type>2</edge_type>
<source_obj>58</source_obj>
<sink_obj>16</sink_obj>
</item>
<item class_id_reference="20" object_id="_147">
<id>277</id>
<edge_type>4</edge_type>
<source_obj>50</source_obj>
<sink_obj>53</sink_obj>
</item>
<item class_id_reference="20" object_id="_148">
<id>278</id>
<edge_type>4</edge_type>
<source_obj>35</source_obj>
<sink_obj>53</sink_obj>
</item>
<item class_id_reference="20" object_id="_149">
<id>279</id>
<edge_type>4</edge_type>
<source_obj>36</source_obj>
<sink_obj>52</sink_obj>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="21" tracking_level="0" version="0">
<count>7</count>
<item_version>0</item_version>
<item class_id="22" tracking_level="1" version="0" object_id="_150">
<mId>1</mId>
<mTag>call_Loop_LB2D_shift</mTag>
<mType>0</mType>
<sub_regions>
<count>3</count>
<item_version>0</item_version>
<item>2</item>
<item>3</item>
<item>7</item>
</sub_regions>
<basic_blocks>
<count>0</count>
<item_version>0</item_version>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>2072995</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"/>
</item>
<item class_id_reference="22" object_id="_151">
<mId>2</mId>
<mTag>Entry</mTag>
<mType>0</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>10</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"/>
</item>
<item class_id_reference="22" object_id="_152">
<mId>3</mId>
<mTag>LB2D_shift</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>1078</mMinTripCount>
<mMaxTripCount>1078</mMaxTripCount>
<mMinLatency>2072994</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"/>
</item>
<item class_id_reference="22" object_id="_153">
<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>16</item>
<item>20</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"/>
</item>
<item class_id_reference="22" object_id="_154">
<mId>5</mId>
<mTag>LB1D_shiftreg</mTag>
<mType>1</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>4</count>
<item_version>0</item_version>
<item>26</item>
<item>34</item>
<item>49</item>
<item>55</item>
</basic_blocks>
<mII>1</mII>
<mDepth>2</mDepth>
<mMinTripCount>1920</mMinTripCount>
<mMaxTripCount>1920</mMaxTripCount>
<mMinLatency>1920</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"/>
</item>
<item class_id_reference="22" object_id="_155">
<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>58</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"/>
</item>
<item class_id_reference="22" object_id="_156">
<mId>7</mId>
<mTag>Return</mTag>
<mType>0</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>60</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"/>
</item>
</cdfg_regions>
<fsm class_id="24" tracking_level="1" version="0" object_id="_157">
<states class_id="25" tracking_level="0" version="0">
<count>5</count>
<item_version>0</item_version>
<item class_id="26" tracking_level="1" version="0" object_id="_158">
<id>1</id>
<operations class_id="27" tracking_level="0" version="0">
<count>7</count>
<item_version>0</item_version>
<item class_id="28" tracking_level="1" version="0" object_id="_159">
<id>3</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_160">
<id>4</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_161">
<id>5</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_162">
<id>6</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_163">
<id>7</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_164">
<id>8</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_165">
<id>9</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_166">
<id>2</id>
<operations>
<count>9</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_167">
<id>11</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_168">
<id>12</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_169">
<id>13</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_170">
<id>14</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_171">
<id>15</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_172">
<id>17</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_173">
<id>18</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_174">
<id>19</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_175">
<id>59</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_176">
<id>3</id>
<operations>
<count>8</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_177">
<id>21</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_178">
<id>22</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_179">
<id>23</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_180">
<id>24</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_181">
<id>25</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_182">
<id>31</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_183">
<id>32</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_184">
<id>33</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_185">
<id>4</id>
<operations>
<count>23</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_186">
<id>27</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_187">
<id>28</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_188">
<id>29</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_189">
<id>30</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_190">
<id>35</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_191">
<id>36</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_192">
<id>37</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_193">
<id>38</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_194">
<id>39</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_195">
<id>40</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_196">
<id>41</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_197">
<id>42</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_198">
<id>43</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_199">
<id>44</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_200">
<id>45</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_201">
<id>46</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_202">
<id>47</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_203">
<id>48</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_204">
<id>50</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_205">
<id>51</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_206">
<id>52</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_207">
<id>53</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_208">
<id>54</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="26" object_id="_209">
<id>5</id>
<operations>
<count>2</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_210">
<id>56</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="28" object_id="_211">
<id>57</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
</states>
<transitions class_id="29" tracking_level="0" version="0">
<count>6</count>
<item_version>0</item_version>
<item class_id="30" tracking_level="1" version="0" object_id="_212">
<inState>1</inState>
<outState>2</outState>
<condition class_id="31" tracking_level="0" version="0">
<id>30</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="_213">
<inState>2</inState>
<outState>3</outState>
<condition>
<id>32</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>12</first>
<second>0</second>
</first>
<second>1</second>
</item>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_214">
<inState>5</inState>
<outState>2</outState>
<condition>
<id>40</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="_215">
<inState>4</inState>
<outState>3</outState>
<condition>
<id>42</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_216">
<inState>3</inState>
<outState>5</outState>
<condition>
<id>41</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>22</first>
<second>0</second>
</first>
<second>0</second>
</item>
</item>
</sop>
</condition>
</item>
<item class_id_reference="30" object_id="_217">
<inState>3</inState>
<outState>4</outState>
<condition>
<id>43</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>22</first>
<second>0</second>
</first>
<second>1</second>
</item>
</item>
</sop>
</condition>
</item>
</transitions>
</fsm>
<res class_id="36" tracking_level="1" version="0" object_id="_218">
<dp_component_resource class_id="37" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_component_resource>
<dp_expression_resource>
<count>10</count>
<item_version>0</item_version>
<item class_id="38" tracking_level="0" version="0">
<first>ap_block_pp0_stage0_flag00001001 ( and ) </first>
<second class_id="39" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="40" tracking_level="0" version="0">
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_block_state1 ( or ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_block_state4_pp0_stage0_iter1 ( or ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_enable_pp0 ( xor ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>2</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>ap_enable_reg_pp0_iter1 ( xor ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>2</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>i_fu_133_p2 ( + ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>11</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>38</second>
</item>
<item>
<first>LUT</first>
<second>16</second>
</item>
</second>
</item>
<item>
<first>icmp_fu_149_p2 ( icmp ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>10</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>5</second>
</item>
</second>
</item>
<item>
<first>n1_1_fu_121_p2 ( + ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>11</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>38</second>
</item>
<item>
<first>LUT</first>
<second>16</second>
</item>
</second>
</item>
<item>
<first>tmp_5_fu_115_p2 ( icmp ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>11</second>
</item>
<item>
<first>(1P1)</first>
<second>11</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>6</second>
</item>
</second>
</item>
<item>
<first>tmp_7_fu_127_p2 ( icmp ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>11</second>
</item>
<item>
<first>(1P1)</first>
<second>9</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>6</second>
</item>
</second>
</item>
</dp_expression_resource>
<dp_fifo_resource>
<count>0</count>
<item_version>0</item_version>
</dp_fifo_resource>
<dp_memory_resource>
<count>0</count>
<item_version>0</item_version>
</dp_memory_resource>
<dp_multiplexer_resource>
<count>7</count>
<item_version>0</item_version>
<item>
<first>ap_NS_fsm</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>5</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>5</second>
</item>
<item>
<first>LUT</first>
<second>27</second>
</item>
</second>
</item>
<item>
<first>ap_done</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>2</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>ap_enable_reg_pp0_iter1</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>3</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>3</second>
</item>
<item>
<first>LUT</first>
<second>15</second>
</item>
</second>
</item>
<item>
<first>i_0_i_i_reg_104</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>11</second>
</item>
<item>
<first>(2Count)</first>
<second>22</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>n1_reg_93</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>11</second>
</item>
<item>
<first>(2Count)</first>
<second>22</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>out_stream_V_value_V_blk_n</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>2</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
<item>
<first>slice_stream_V_value_V_blk_n</first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0Size)</first>
<second>2</second>
</item>
<item>
<first>(1Bits)</first>
<second>1</second>
</item>
<item>
<first>(2Count)</first>
<second>2</second>
</item>
<item>
<first>LUT</first>
<second>9</second>
</item>
</second>
</item>
</dp_multiplexer_resource>
<dp_register_resource>
<count>11</count>
<item_version>0</item_version>
<item>
<first>ap_CS_fsm</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>4</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>4</second>
</item>
</second>
</item>
<item>
<first>ap_done_reg</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>1</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>ap_enable_reg_pp0_iter0</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>1</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>ap_enable_reg_pp0_iter1</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>1</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>1</second>
</item>
</second>
</item>
<item>
<first>buffer_0_value_V_fu_76</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>96</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>96</second>
</item>
</second>
</item>
<item>
<first>buffer_1_value_V_fu_72</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>96</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>96</second>
</item>
</second>
</item>
<item>
<first>i_0_i_i_reg_104</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>11</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>11</second>
</item>
</second>
</item>
<item>
<first>icmp_reg_300</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>n1_1_reg_286</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>11</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>11</second>
</item>
</second>
</item>
<item>
<first>n1_reg_93</first>
<second>
<count>3</count>
<item_version>0</item_version>
<item>
<first>(Bits)</first>
<second>11</second>
</item>
<item>
<first>(Consts)</first>
<second>0</second>
</item>
<item>
<first>FF</first>
<second>11</second>
</item>
</second>
</item>
<item>
<first>tmp_7_reg_291</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_component_map class_id="41" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_component_map>
<dp_expression_map>
<count>5</count>
<item_version>0</item_version>
<item class_id="42" tracking_level="0" version="0">
<first>i_fu_133_p2 ( + ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>icmp_fu_149_p2 ( icmp ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
<item>
<first>n1_1_fu_121_p2 ( + ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>14</item>
</second>
</item>
<item>
<first>tmp_5_fu_115_p2 ( icmp ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>tmp_7_fu_127_p2 ( icmp ) </first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
</dp_expression_map>
<dp_fifo_map>
<count>0</count>
<item_version>0</item_version>
</dp_fifo_map>
<dp_memory_map>
<count>0</count>
<item_version>0</item_version>
</dp_memory_map>
</res>
<node_label_latency class_id="43" tracking_level="0" version="0">
<count>36</count>
<item_version>0</item_version>
<item class_id="44" tracking_level="0" version="0">
<first>3</first>
<second class_id="45" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>4</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>9</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>11</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>12</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>14</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>15</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>19</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>21</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>22</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>24</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>25</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>30</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>31</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>32</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>33</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>35</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>36</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>37</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>38</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>39</first>
<second>
<first>3</first>
<second>0</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>42</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>43</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>44</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>45</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>46</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>47</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>48</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>50</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>52</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>53</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>54</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>57</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>59</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="46" tracking_level="0" version="0">
<count>9</count>
<item_version>0</item_version>
<item class_id="47" tracking_level="0" version="0">
<first>10</first>
<second class_id="48" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>16</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>20</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>26</first>
<second>
<first>2</first>
<second>2</second>
</second>
</item>
<item>
<first>34</first>
<second>
<first>2</first>
<second>3</second>
</second>
</item>
<item>
<first>49</first>
<second>
<first>3</first>
<second>3</second>
</second>
</item>
<item>
<first>55</first>
<second>
<first>3</first>
<second>3</second>
</second>
</item>
<item>
<first>58</first>
<second>
<first>3</first>
<second>3</second>
</second>
</item>
<item>
<first>60</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="49" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="50" tracking_level="1" version="0" object_id="_219">
<region_name>LB1D_shiftreg</region_name>
<basic_blocks>
<count>4</count>
<item_version>0</item_version>
<item>26</item>
<item>34</item>
<item>49</item>
<item>55</item>
</basic_blocks>
<nodes>
<count>0</count>
<item_version>0</item_version>
</nodes>
<anchor_node>-1</anchor_node>
<region_type>8</region_type>
<interval>1</interval>
<pipe_depth>2</pipe_depth>
</item>
</regions>
<dp_fu_nodes class_id="51" tracking_level="0" version="0">
<count>27</count>
<item_version>0</item_version>
<item class_id="52" tracking_level="0" version="0">
<first>72</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>3</item>
</second>
</item>
<item>
<first>76</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>4</item>
</second>
</item>
<item>
<first>80</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>86</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
<item>
<first>97</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
<item>
<first>108</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>115</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>121</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>14</item>
</second>
</item>
<item>
<first>127</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>133</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>139</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
<item>
<first>149</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
<item>
<first>155</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>35</item>
</second>
</item>
<item>
<first>158</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>161</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>165</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>38</item>
</second>
</item>
<item>
<first>169</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</second>
</item>
<item>
<first>173</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>40</item>
</second>
</item>
<item>
<first>183</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>41</item>
</second>
</item>
<item>
<first>193</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>42</item>
</second>
</item>
<item>
<first>203</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>43</item>
</second>
</item>
<item>
<first>213</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>44</item>
</second>
</item>
<item>
<first>223</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>233</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</second>
</item>
<item>
<first>256</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>50</item>
</second>
</item>
<item>
<first>259</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>52</item>
</second>
</item>
<item>
<first>264</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>53</item>
</second>
</item>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="54" tracking_level="0" version="0">
<count>20</count>
<item_version>0</item_version>
<item class_id="55" tracking_level="0" version="0">
<first>buffer_0_value_V_fu_76</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>4</item>
</second>
</item>
<item>
<first>buffer_1_value_V_fu_72</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>3</item>
</second>
</item>
<item>
<first>i_0_i_i_phi_fu_108</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>i_fu_133</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>icmp_fu_149</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
<item>
<first>n1_1_fu_121</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>14</item>
</second>
</item>
<item>
<first>n1_phi_fu_97</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
<item>
<first>p_Result_20_1_1_fu_183</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>41</item>
</second>
</item>
<item>
<first>p_Result_20_1_2_fu_193</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>42</item>
</second>
</item>
<item>
<first>p_Result_20_1_fu_173</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>40</item>
</second>
</item>
<item>
<first>p_Result_20_2_1_fu_213</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>44</item>
</second>
</item>
<item>
<first>p_Result_20_2_2_fu_223</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>p_Result_20_2_fu_203</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>43</item>
</second>
</item>
<item>
<first>tmp_1_fu_161</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>37</item>
</second>
</item>
<item>
<first>tmp_2_fu_165</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>38</item>
</second>
</item>
<item>
<first>tmp_4_fu_169</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</second>
</item>
<item>
<first>tmp_5_fu_115</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>tmp_7_fu_127</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>tmp_fu_139</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
<item>
<first>tmp_value_V_fu_233</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</second>
</item>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_module>
<dp_fu_nodes_io>
<count>7</count>
<item_version>0</item_version>
<item>
<first>StgValue_46_write_fu_86</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
<item>
<first>StgValue_50_store_fu_259</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>52</item>
</second>
</item>
<item>
<first>StgValue_51_store_fu_264</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>53</item>
</second>
</item>
<item>
<first>buffer_0_value_V_lo_load_fu_158</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>36</item>
</second>
</item>
<item>
<first>buffer_1_value_V_lo_1_load_fu_155</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>35</item>
</second>
</item>
<item>
<first>buffer_1_value_V_lo_load_fu_256</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>50</item>
</second>
</item>
<item>
<first>tmp_value_V_1_read_fu_80</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
</dp_fu_nodes_io>
<return_ports>
<count>0</count>
<item_version>0</item_version>
</return_ports>
<dp_mem_port_nodes class_id="56" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>9</count>
<item_version>0</item_version>
<item>
<first>93</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
<item>
<first>104</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>269</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>3</item>
</second>
</item>
<item>
<first>276</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>4</item>
</second>
</item>
<item>
<first>282</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>286</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>14</item>
</second>
</item>
<item>
<first>291</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>295</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>300</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
</dp_reg_nodes>
<dp_regname_nodes>
<count>9</count>
<item_version>0</item_version>
<item>
<first>buffer_0_value_V_reg_276</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>4</item>
</second>
</item>
<item>
<first>buffer_1_value_V_reg_269</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>3</item>
</second>
</item>
<item>
<first>i_0_i_i_reg_104</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>i_reg_295</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>icmp_reg_300</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
<item>
<first>n1_1_reg_286</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>14</item>
</second>
</item>
<item>
<first>n1_reg_93</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
<item>
<first>tmp_5_reg_282</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>tmp_7_reg_291</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
</dp_regname_nodes>
<dp_reg_phi>
<count>2</count>
<item_version>0</item_version>
<item>
<first>93</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
<item>
<first>104</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
</dp_reg_phi>
<dp_regname_phi>
<count>2</count>
<item_version>0</item_version>
<item>
<first>i_0_i_i_reg_104</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>n1_reg_93</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</second>
</item>
</dp_regname_phi>
<dp_port_io_nodes class_id="57" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="58" tracking_level="0" version="0">
<first>out_stream_V_value_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>write</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
</second>
</item>
<item>
<first>slice_stream_V_value_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
</second>
</item>
</dp_port_io_nodes>
<port2core class_id="59" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="60" tracking_level="0" version="0">
<first>1</first>
<second>FIFO_SRL</second>
</item>
<item>
<first>2</first>
<second>FIFO_SRL</second>
</item>
</port2core>
<node2core>
<count>0</count>
<item_version>0</item_version>
</node2core>
</syndb>
</boost_serialization>
|
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2020 onox <denkpadje@gmail.com>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with Ada.Unchecked_Conversion;
with EGL.API;
package body EGL.Loading is
generic
type Function_Reference is private;
function Load (Function_Name : String) return Function_Reference;
function Load (Function_Name : String) return Function_Reference is
function As_Function_Reference is new Ada.Unchecked_Conversion
(Source => System.Address, Target => Function_Reference);
begin
return As_Function_Reference (API.Get_Proc_Address (C.To_C (Function_Name)));
end Load;
package body Function_With_2_Params is
function Init
(Param1 : Param1_Type;
Param2 : Param2_Type) return Return_Type
is
function Load_Function is new Load (Function_Reference);
begin
Ref := Load_Function (Function_Name);
return Ref (Param1, Param2);
end Init;
end Function_With_2_Params;
package body Function_With_3_Params is
function Init
(Param1 : Param1_Type;
Param2 : Param2_Type;
Param3 : Param3_Type) return Return_Type
is
function Load_Function is new Load (Function_Reference);
begin
Ref := Load_Function (Function_Name);
return Ref (Param1, Param2, Param3);
end Init;
end Function_With_3_Params;
package body Function_With_4_Params is
function Init
(Param1 : Param1_Type;
Param2 : Param2_Type;
Param3 : Param3_Type;
Param4 : Param4_Type) return Return_Type
is
function Load_Function is new Load (Function_Reference);
begin
Ref := Load_Function (Function_Name);
return Ref (Param1, Param2, Param3, Param4);
end Init;
end Function_With_4_Params;
package body Array_Getter_With_3_Params is
function Init
(Param1 : Param1_Type;
Values : in out Array_Type;
Size : in out Size_Type) return Return_Type
is
function Load_Function is new Load (Function_Reference);
begin
Ref := Load_Function (Function_Name);
return Ref (Param1, Values, Size);
end Init;
end Array_Getter_With_3_Params;
package body Getter_With_3_Params is
function Init
(Param1 : Param1_Type;
Param2 : Param2_Type;
Param3 : out Param3_Type) return Return_Type
is
function Load_Function is new Load (Function_Reference);
begin
Ref := Load_Function (Function_Name);
return Ref (Param1, Param2, Param3);
end Init;
end Getter_With_3_Params;
end EGL.Loading;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- SYSTEM.TASK_PRIMITIVES.OPERATIONS.SPECIFIC --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This is a VxWorks version of this package where foreign threads are
-- recognized. The implementation is based on VxWorks taskVarLib.
separate (System.Task_Primitives.Operations)
package body Specific is
ATCB_Key : aliased System.Address := System.Null_Address;
-- Key used to find the Ada Task_Id associated with a thread
ATCB_Key_Addr : System.Address := ATCB_Key'Address;
pragma Export (Ada, ATCB_Key_Addr, "__gnat_ATCB_key_addr");
-- Exported to support the temporary AE653 task registration
-- implementation. This mechanism is used to minimize impact on other
-- targets.
Stack_Limit : aliased System.Address;
pragma Import (C, Stack_Limit, "__gnat_stack_limit");
type Set_Stack_Limit_Proc_Acc is access procedure;
pragma Convention (C, Set_Stack_Limit_Proc_Acc);
Set_Stack_Limit_Hook : Set_Stack_Limit_Proc_Acc;
pragma Import (C, Set_Stack_Limit_Hook, "__gnat_set_stack_limit_hook");
-- Procedure to be called when a task is created to set stack limit if
-- limit checking is used.
----------------
-- Initialize --
----------------
procedure Initialize is
begin
null;
end Initialize;
-------------------
-- Is_Valid_Task --
-------------------
function Is_Valid_Task return Boolean is
begin
return taskVarGet (taskIdSelf, ATCB_Key'Access) /= ERROR;
end Is_Valid_Task;
---------
-- Set --
---------
procedure Set (Self_Id : Task_Id) is
Result : STATUS;
begin
-- If argument is null, destroy task specific data, to make API
-- consistent with other platforms, and thus compatible with the
-- shared version of s-tpoaal.adb.
if Self_Id = null then
Result := taskVarDelete (taskIdSelf, ATCB_Key'Access);
pragma Assert (Result /= ERROR);
return;
end if;
if not Is_Valid_Task then
Result := taskVarAdd (Self_Id.Common.LL.Thread, ATCB_Key'Access);
pragma Assert (Result = OK);
if Stack_Check_Limits
and then Result /= ERROR
and then Set_Stack_Limit_Hook /= null
then
-- This will be initialized from taskInfoGet() once the task is
-- is running.
Result :=
taskVarAdd (Self_Id.Common.LL.Thread, Stack_Limit'Access);
pragma Assert (Result /= ERROR);
end if;
end if;
Result :=
taskVarSet
(Self_Id.Common.LL.Thread,
ATCB_Key'Access,
To_Address (Self_Id));
pragma Assert (Result /= ERROR);
end Set;
----------
-- Self --
----------
-- To make Ada tasks and C threads interoperate better, we have added some
-- functionality to Self. Suppose a C main program (with threads) calls an
-- Ada procedure and the Ada procedure calls the tasking runtime system.
-- Eventually, a call will be made to self. Since the call is not coming
-- from an Ada task, there will be no corresponding ATCB.
-- What we do in Self is to catch references that do not come from
-- recognized Ada tasks, and create an ATCB for the calling thread.
-- The new ATCB will be "detached" from the normal Ada task master
-- hierarchy, much like the existing implicitly created signal-server
-- tasks.
function Self return Task_Id is
Result : constant Task_Id := To_Task_Id (ATCB_Key);
begin
if Result /= null then
return Result;
else
-- If the value is Null then it is a non-Ada task
return Register_Foreign_Thread;
end if;
end Self;
end Specific;
|
-- This file is covered by the Internet Software Consortium (ISC) License
-- Reference: ../../License.txt
package body AdaBase.Statement.Base.PostgreSQL is
------------------------
-- reformat_markers --
------------------------
function reformat_markers (parameterized_sql : String) return String
is
masked : String := CT.redact_quotes (parameterized_sql);
cvslen : Natural := masked'Length;
begin
for x in masked'Range loop
if masked (x) = ASCII.Query then
-- Reserve enough for 9999 markers (limit 1600 on PgSQL)
-- Trailing whitespace is truncated by the return
cvslen := cvslen + 4;
end if;
end loop;
declare
canvas : String (1 .. cvslen) := (others => ' ');
polaris : Natural := 0;
param : Natural := 0;
begin
for x in masked'Range loop
if masked (x) = ASCII.Query then
param := param + 1;
declare
marker : String := ASCII.Dollar & CT.int2str (param);
begin
for y in marker'Range loop
polaris := polaris + 1;
canvas (polaris) := marker (y);
end loop;
end;
else
polaris := polaris + 1;
canvas (polaris) := parameterized_sql (x);
end if;
end loop;
return canvas (1 .. polaris);
end;
end reformat_markers;
--------------------
-- column_count --
--------------------
overriding
function column_count (Stmt : PostgreSQL_statement) return Natural is
begin
return Stmt.num_columns;
end column_count;
----------------------
-- last_insert_id --
----------------------
overriding
function last_insert_id (Stmt : PostgreSQL_statement) return Trax_ID
is
conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn;
begin
if Stmt.insert_return then
return Stmt.last_inserted;
else
return conn.select_last_val;
end if;
end last_insert_id;
----------------------
-- last_sql_state --
----------------------
overriding
function last_sql_state (Stmt : PostgreSQL_statement) return SQL_State
is
conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn;
begin
return conn.SqlState (Stmt.result_handle);
end last_sql_state;
------------------------
-- last_driver_code --
------------------------
overriding
function last_driver_code (Stmt : PostgreSQL_statement) return Driver_Codes
is
conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn;
begin
return conn.driverCode (Stmt.result_handle);
end last_driver_code;
---------------------------
-- last_driver_message --
---------------------------
overriding
function last_driver_message (Stmt : PostgreSQL_statement) return String
is
conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn;
begin
return conn.driverMessage (Stmt.result_handle);
end last_driver_message;
--------------------
-- discard_rest --
--------------------
overriding
procedure discard_rest (Stmt : out PostgreSQL_statement)
is
-- When asynchronous command mode becomes supported, this procedure
-- would free the pgres object and indicate data exhausted somehow.
-- In the standard buffered mode, we can only simulate it.
conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn;
begin
if Stmt.result_arrow < Stmt.size_of_rowset then
Stmt.result_arrow := Stmt.size_of_rowset;
Stmt.rows_leftover := True;
conn.discard_pgresult (Stmt.result_handle);
end if;
end discard_rest;
------------------
-- execute #1 --
------------------
overriding
function execute (Stmt : out PostgreSQL_statement) return Boolean
is
conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn;
markers : constant Natural := Natural (Stmt.realmccoy.Length);
status_successful : Boolean := True;
data_present : Boolean := False;
begin
if Stmt.type_of_statement = direct_statement then
raise INVALID_FOR_DIRECT_QUERY
with "The execute command is for prepared statements only";
end if;
Stmt.result_arrow := 0;
Stmt.last_inserted := 0;
Stmt.size_of_rowset := 0;
Stmt.impacted := 0;
Stmt.rows_leftover := False;
Stmt.result_present := False;
Stmt.successful_execution := False;
conn.discard_pgresult (Stmt.result_handle);
if markers > 0 then
-- Check to make sure all prepared markers are bound
for sx in Natural range 1 .. markers loop
if not Stmt.realmccoy.Element (sx).bound then
raise STMT_PREPARATION
with "Prep Stmt column" & sx'Img & " unbound";
end if;
end loop;
-- Now bind the actual values to the markers
declare
canvas : CON.parameter_block (1 .. markers);
msg : String := "Exec with" & markers'Img & " bound parameters";
begin
for x in canvas'Range loop
canvas (x).payload := Stmt.bind_text_value (x);
canvas (x).is_null := Stmt.realmccoy.Element (x).null_data;
canvas (x).binary := Stmt.realmccoy.Element (x).output_type =
ft_chain;
end loop;
Stmt.log_nominal (statement_execution, msg);
Stmt.result_handle := conn.execute_prepared_stmt
(name => Stmt.show_statement_name,
data => canvas);
end;
else
-- No binding required, just execute the prepared statement
Stmt.log_nominal (category => statement_execution,
message => "Exec without bound parameters");
Stmt.result_handle := conn.execute_prepared_stmt
(name => Stmt.show_statement_name);
end if;
case conn.examine_result (Stmt.result_handle) is
when CON.executed =>
Stmt.successful_execution := True;
when CON.returned_data =>
Stmt.successful_execution := True;
Stmt.insert_return := Stmt.insert_prepsql;
data_present := True;
when CON.failed =>
Stmt.successful_execution := False;
end case;
if Stmt.successful_execution then
if data_present then
if Stmt.insert_return then
Stmt.last_inserted := conn.returned_id (Stmt.result_handle);
else
Stmt.size_of_rowset := conn.rows_in_result (Stmt.result_handle);
Stmt.result_present := True;
end if;
end if;
Stmt.impacted := conn.rows_impacted (Stmt.result_handle);
end if;
return Stmt.successful_execution;
end execute;
------------------
-- execute #2 --
------------------
overriding
function execute (Stmt : out PostgreSQL_statement; parameters : String;
delimiter : Character := '|') return Boolean
is
function parameters_given return Natural;
num_markers : constant Natural := Natural (Stmt.realmccoy.Length);
function parameters_given return Natural
is
result : Natural := 1;
begin
for x in parameters'Range loop
if parameters (x) = delimiter then
result := result + 1;
end if;
end loop;
return result;
end parameters_given;
begin
if Stmt.type_of_statement = direct_statement then
raise INVALID_FOR_DIRECT_QUERY
with "The execute command is for prepared statements only";
end if;
if num_markers /= parameters_given then
raise STMT_PREPARATION
with "Parameter number mismatch, " & num_markers'Img &
" expected, but" & parameters_given'Img & " provided.";
end if;
declare
index : Natural := 1;
arrow : Natural := parameters'First;
scans : Boolean := False;
start : Natural := 1;
stop : Natural := 0;
begin
for x in parameters'Range loop
if parameters (x) = delimiter then
if not scans then
Stmt.auto_assign (index, "");
else
Stmt.auto_assign (index, parameters (start .. stop));
scans := False;
end if;
index := index + 1;
else
stop := x;
if not scans then
start := x;
scans := True;
end if;
end if;
end loop;
if not scans then
Stmt.auto_assign (index, "");
else
Stmt.auto_assign (index, parameters (start .. stop));
end if;
end;
return Stmt.execute;
end execute;
---------------------
-- rows_returned --
---------------------
overriding
function rows_returned (Stmt : PostgreSQL_statement) return Affected_Rows
is
begin
return Stmt.size_of_rowset;
end rows_returned;
-------------------
-- column_name --
-------------------
overriding
function column_name (Stmt : PostgreSQL_statement; index : Positive)
return String
is
maxlen : constant Natural := Natural (Stmt.column_info.Length);
begin
if index > maxlen then
raise INVALID_COLUMN_INDEX with "Max index is" & maxlen'Img &
" but" & index'Img & " attempted";
end if;
return CT.USS (Stmt.column_info.Element (Index => index).field_name);
end column_name;
--------------------
-- column_table --
--------------------
overriding
function column_table (Stmt : PostgreSQL_statement; index : Positive)
return String
is
maxlen : constant Natural := Natural (Stmt.column_info.Length);
begin
if index > maxlen then
raise INVALID_COLUMN_INDEX with "Max index is" & maxlen'Img &
" but" & index'Img & " attempted";
end if;
return CT.USS (Stmt.column_info.Element (Index => index).table);
end column_table;
--------------------------
-- column_native_type --
--------------------------
overriding
function column_native_type (Stmt : PostgreSQL_statement; index : Positive)
return field_types
is
maxlen : constant Natural := Natural (Stmt.column_info.Length);
begin
if index > maxlen then
raise INVALID_COLUMN_INDEX with "Max index is" & maxlen'Img &
" but" & index'Img & " attempted";
end if;
return Stmt.column_info.Element (Index => index).field_type;
end column_native_type;
------------------
-- fetch_next --
------------------
overriding
function fetch_next (Stmt : out PostgreSQL_statement) return ARS.Datarow is
begin
if Stmt.result_arrow >= Stmt.size_of_rowset then
return ARS.Empty_Datarow;
end if;
Stmt.result_arrow := Stmt.result_arrow + 1;
return Stmt.assemble_datarow (row_number => Stmt.result_arrow);
end fetch_next;
-----------------
-- fetch_all --
-----------------
overriding
function fetch_all (Stmt : out PostgreSQL_statement) return ARS.Datarow_Set
is
maxrows : Natural := Natural (Stmt.rows_returned);
tmpset : ARS.Datarow_Set (1 .. maxrows + 1);
nullset : ARS.Datarow_Set (1 .. 0);
index : Natural := 1;
row : ARS.Datarow;
begin
if Stmt.result_arrow >= Stmt.size_of_rowset then
return nullset;
end if;
declare
remaining_rows : Trax_ID := Stmt.size_of_rowset - Stmt.result_arrow;
return_set : ARS.Datarow_Set (1 .. Natural (remaining_rows));
begin
for index in return_set'Range loop
Stmt.result_arrow := Stmt.result_arrow + 1;
return_set (index) := Stmt.assemble_datarow (Stmt.result_arrow);
end loop;
return return_set;
end;
end fetch_all;
-------------------
-- fetch_bound --
-------------------
overriding
function fetch_bound (Stmt : out PostgreSQL_statement) return Boolean
is
function null_value (column : Natural) return Boolean;
function string_equivalent (column : Natural; binary : Boolean)
return String;
conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn;
function string_equivalent (column : Natural; binary : Boolean)
return String
is
-- PostgreSQL result set is zero-indexed
row_num : constant Natural := Natural (Stmt.result_arrow) - 1;
col_num : constant Natural := column - 1;
begin
if binary then
return conn.field_chain (Stmt.result_handle, row_num, col_num,
Stmt.con_max_blob);
else
return conn.field_string (Stmt.result_handle, row_num, col_num);
end if;
end string_equivalent;
function null_value (column : Natural) return Boolean
is
-- PostgreSQL result set is zero-indexed
row_num : constant Natural := Natural (Stmt.result_arrow) - 1;
col_num : constant Natural := column - 1;
begin
return conn.field_is_null (Stmt.result_handle, row_num, col_num);
end null_value;
begin
if Stmt.result_arrow >= Stmt.size_of_rowset then
return False;
end if;
Stmt.result_arrow := Stmt.result_arrow + 1;
declare
maxlen : constant Natural := Stmt.num_columns;
begin
for F in 1 .. maxlen loop
declare
dossier : bindrec renames Stmt.crate.Element (F);
colinfo : column_info renames Stmt.column_info.Element (F);
Tout : constant field_types := dossier.output_type;
Tnative : constant field_types := colinfo.field_type;
isnull : constant Boolean := null_value (F);
errmsg : constant String := "native type : " &
field_types'Image (Tnative) & " binding type : " &
field_types'Image (Tout);
smallerr : constant String := "Native unsigned type : " &
field_types'Image (Tnative) & " is too small for " &
field_types'Image (Tout) & " binding type";
ST : constant String :=
string_equivalent (F, colinfo.binary_format);
begin
if not dossier.bound then
goto continue;
end if;
if isnull or else CT.IsBlank (ST) then
set_as_null (dossier);
goto continue;
end if;
-- Because PostgreSQL does not support unsigned integer
-- types, allow binding NByteX binding to ByteX types, but
-- remain strict on other type mismatches.
case Tout is
when ft_nbyte1 =>
case Tnative is
when ft_byte1 | ft_byte2 | ft_byte3 | ft_byte4 |
ft_byte8 | ft_nbyte2 | ft_nbyte3 | ft_nbyte4 |
ft_nbyte8 =>
null; -- Fall through (all could fail to convert)
when ft_nbyte1 =>
null; -- guaranteed to convert
when others =>
raise BINDING_TYPE_MISMATCH with errmsg;
end case;
when ft_nbyte2 =>
case Tnative is
when ft_byte2 | ft_byte3 | ft_byte4 | ft_byte8 |
ft_nbyte3 | ft_nbyte4 | ft_nbyte8 =>
null; -- Fall through (all could fail to convert)
when ft_nbyte1 | ft_nbyte2 =>
null; -- guaranteed to convert
when ft_byte1 =>
raise BINDING_TYPE_MISMATCH with smallerr;
when others =>
raise BINDING_TYPE_MISMATCH with errmsg;
end case;
when ft_nbyte3 =>
case Tnative is
when ft_byte3 | ft_byte4 | ft_byte8 | ft_nbyte4 |
ft_nbyte8 =>
null; -- Fall through (all could fail to convert)
when ft_nbyte1 | ft_nbyte2 | ft_nbyte3 =>
null; -- guaranteed to convert
when ft_byte1 | ft_byte2 =>
raise BINDING_TYPE_MISMATCH with smallerr;
when others =>
raise BINDING_TYPE_MISMATCH with errmsg;
end case;
when ft_nbyte4 =>
case Tnative is
when ft_byte4 | ft_byte8 | ft_nbyte8 =>
null; -- Fall through (all could fail to convert)
when ft_nbyte1 | ft_nbyte2 | ft_nbyte3 | ft_nbyte4 =>
null; -- guaranteed to convert
when ft_byte1 | ft_byte2 | ft_byte3 =>
raise BINDING_TYPE_MISMATCH with smallerr;
when others =>
raise BINDING_TYPE_MISMATCH with errmsg;
end case;
when ft_nbyte8 =>
case Tnative is
when ft_byte8 =>
null; -- Fall through (could fail to convert)
when ft_nbyte1 | ft_nbyte2 | ft_nbyte3 | ft_nbyte4 |
ft_nbyte8 =>
null; -- guaranteed to convert
when ft_byte1 | ft_byte2 | ft_byte3 | ft_byte4 =>
raise BINDING_TYPE_MISMATCH with smallerr;
when others =>
raise BINDING_TYPE_MISMATCH with errmsg;
end case;
when ft_byte1 =>
case Tnative is
when ft_byte2 =>
null; -- smallest poss. type (could fail to conv)
when ft_byte1 =>
null; -- guaranteed to convert but impossible case
when others =>
raise BINDING_TYPE_MISMATCH with errmsg;
end case;
when ft_byte3 =>
case Tnative is
when ft_byte4 =>
null; -- smallest poss. type (could fail to conv)
when ft_byte1 | ft_byte2 | ft_byte3 =>
null; -- guaranteed to convert (1/3 imposs.)
when others =>
raise BINDING_TYPE_MISMATCH with errmsg;
end case;
when ft_real18 =>
case Tnative is
when ft_real9 | ft_real18 =>
null; -- guaranteed to convert without loss
when others =>
raise BINDING_TYPE_MISMATCH with errmsg;
end case;
when ft_textual =>
case Tnative is
when ft_settype =>
null; -- No support for Sets in pgsql, conv->str
when ft_textual | ft_widetext | ft_supertext =>
null;
when ft_utf8 =>
null; -- UTF8 needs contraints, allow textual
when others =>
raise BINDING_TYPE_MISMATCH with errmsg;
end case;
when ft_settype =>
case Tnative is
when ft_textual | ft_utf8 =>
null; -- No support for Sets in pgsql, conv->set
when ft_settype =>
null; -- impossible
when others =>
raise BINDING_TYPE_MISMATCH with errmsg;
end case;
when others =>
if Tnative /= Tout then
raise BINDING_TYPE_MISMATCH with errmsg;
end if;
end case;
case Tout is
when ft_nbyte0 => dossier.a00.all := (ST = "t");
when ft_nbyte1 => dossier.a01.all := convert (ST);
when ft_nbyte2 => dossier.a02.all := convert (ST);
when ft_nbyte3 => dossier.a03.all := convert (ST);
when ft_nbyte4 => dossier.a04.all := convert (ST);
when ft_nbyte8 => dossier.a05.all := convert (ST);
when ft_byte1 => dossier.a06.all := convert (ST);
when ft_byte2 => dossier.a07.all := convert (ST);
when ft_byte3 => dossier.a08.all := convert (ST);
when ft_byte4 => dossier.a09.all := convert (ST);
when ft_byte8 => dossier.a10.all := convert (ST);
when ft_real9 => dossier.a11.all := convert (ST);
when ft_real18 => dossier.a12.all := convert (ST);
when ft_textual => dossier.a13.all := CT.SUS (ST);
when ft_widetext => dossier.a14.all := convert (ST);
when ft_supertext => dossier.a15.all := convert (ST);
when ft_enumtype => dossier.a18.all := ARC.convert (ST);
when ft_utf8 => dossier.a21.all := ST;
when ft_geometry =>
dossier.a22.all :=
WKB.Translate_WKB (postgis_to_WKB (ST));
when ft_timestamp =>
begin
dossier.a16.all := ARC.convert (ST);
exception
when AR.CONVERSION_FAILED =>
dossier.a16.all := AR.PARAM_IS_TIMESTAMP;
end;
when ft_chain =>
declare
FL : Natural := dossier.a17.all'Length;
DVLEN : Natural := ST'Length;
begin
if DVLEN > FL then
raise BINDING_SIZE_MISMATCH with "native size : " &
DVLEN'Img & " greater than binding size : " &
FL'Img;
end if;
dossier.a17.all := ARC.convert (ST, FL);
end;
when ft_settype =>
declare
FL : Natural := dossier.a19.all'Length;
items : constant Natural := CT.num_set_items (ST);
begin
if items > FL then
raise BINDING_SIZE_MISMATCH with
"native size : " & items'Img &
" greater than binding size : " & FL'Img;
end if;
dossier.a19.all := ARC.convert (ST, FL);
end;
when ft_bits =>
declare
FL : Natural := dossier.a20.all'Length;
DVLEN : Natural := ST'Length;
begin
if DVLEN > FL then
raise BINDING_SIZE_MISMATCH with "native size : " &
DVLEN'Img & " greater than binding size : " &
FL'Img;
end if;
dossier.a20.all := ARC.convert (ST, FL);
end;
end case;
end;
<<continue>>
end loop;
end;
if Stmt.result_arrow = Stmt.size_of_rowset then
conn.discard_pgresult (Stmt.result_handle);
end if;
return True;
end fetch_bound;
----------------------
-- fetch_next_set --
----------------------
overriding
procedure fetch_next_set (Stmt : out PostgreSQL_statement;
data_present : out Boolean;
data_fetched : out Boolean)
is
conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn;
next_call : constant String := Stmt.pop_result_set_reference;
SQL : constant String := "FETCH ALL IN " &
ASCII.Quotation & next_call & ASCII.Quotation;
begin
data_fetched := False;
data_present := False;
if CT.IsBlank (next_call) then
return;
end if;
-- Clear existing results
conn.discard_pgresult (Stmt.result_handle);
Stmt.column_info.Clear;
Stmt.alpha_markers.Clear;
Stmt.headings_map.Clear;
Stmt.crate.Clear;
Stmt.realmccoy.Clear;
Stmt.result_present := False;
Stmt.rows_leftover := False;
Stmt.insert_return := False;
Stmt.impacted := 0;
Stmt.assign_counter := 0;
Stmt.size_of_rowset := 0;
Stmt.num_columns := 0;
Stmt.result_arrow := 0;
Stmt.last_inserted := 0;
-- execute next query
if conn.direct_stmt_exec (Stmt.result_handle, SQL) then
Stmt.log_nominal (category => miscellaneous,
message => "Stored procs next set: " & SQL);
case conn.examine_result (Stmt.result_handle) is
when CON.executed =>
data_present := True;
Stmt.successful_execution := True;
when CON.returned_data =>
data_present := True;
data_fetched := True;
Stmt.successful_execution := True;
Stmt.insert_return := Stmt.insert_prepsql;
when CON.failed =>
Stmt.successful_execution := False;
end case;
if not Stmt.insert_return then
Stmt.size_of_rowset := conn.rows_in_result (Stmt.result_handle);
end if;
if Stmt.insert_return then
Stmt.last_inserted := conn.returned_id (Stmt.result_handle);
end if;
Stmt.scan_column_information (Stmt.result_handle);
else
Stmt.log_problem
(category => miscellaneous,
message => "Stored procs: Failed fetch next rowset " & next_call);
end if;
end fetch_next_set;
------------------
-- initialize --
------------------
overriding
procedure initialize (Object : in out PostgreSQL_statement)
is
use type CON.PostgreSQL_Connection_Access;
conn : CON.PostgreSQL_Connection_Access renames Object.pgsql_conn;
logcat : Log_Category;
params : Natural;
stmt_name : String := Object.show_statement_name;
hold_result : aliased BND.PGresult_Access;
begin
if conn = null then
return;
end if;
logger_access := Object.log_handler;
Object.dialect := driver_postgresql;
Object.connection := ACB.Base_Connection_Access (conn);
Object.insert_prepsql := False;
--------------------------------
-- Set SQL and log category --
--------------------------------
case Object.type_of_statement is
when direct_statement =>
Object.sql_final := new String'(CT.trim_sql
(Object.initial_sql.all));
logcat := statement_execution;
when prepared_statement =>
Object.sql_final :=
new String'(reformat_markers (Object.transform_sql
(Object.initial_sql.all)));
logcat := statement_preparation;
end case;
--------------------------------------------------------
-- Detect INSERT commands (for INSERT .. RETURNING) --
--------------------------------------------------------
declare
sql : String := Object.initial_sql.all;
begin
if sql'Length > 12 and then
ACH.To_Upper (sql (sql'First .. sql'First + 6)) = "INSERT "
then
Object.insert_prepsql := True;
end if;
end;
if Object.type_of_statement = prepared_statement then
-----------------------------------
-- Prepared Statement handling --
-----------------------------------
if conn.prepare_statement (stmt => Object.prepared_stmt,
name => stmt_name,
sql => Object.sql_final.all)
then
Object.stmt_allocated := True;
Object.log_nominal (category => logcat,
message => stmt_name & " - " &
Object.sql_final.all);
else
Object.log_problem (statement_preparation,
conn.driverMessage (Object.prepared_stmt));
Object.log_problem
(category => statement_preparation,
message => "Failed to prepare SQL query: '" &
Object.sql_final.all & "'",
break => True);
return;
end if;
---------------------------------------
-- Get column metadata (prep stmt) --
---------------------------------------
if conn.prepare_metadata (meta => hold_result,
name => stmt_name)
then
Object.scan_column_information (hold_result);
params := conn.markers_found (hold_result);
conn.discard_pgresult (hold_result);
else
conn.discard_pgresult (hold_result);
Object.log_problem (statement_preparation,
conn.driverMessage (hold_result));
Object.log_problem
(category => statement_preparation,
message => "Failed to acquire prep statement metadata (" &
stmt_name & ")",
break => True);
return;
end if;
------------------------------------------------------
-- Check that we have as many markers as expected --
------------------------------------------------------
declare
errmsg : String := "marker mismatch," &
Object.realmccoy.Length'Img & " expected but" &
params'Img & " found by PostgreSQL";
begin
if params /= Natural (Object.realmccoy.Length) then
Object.log_problem
(category => statement_preparation,
message => errmsg,
break => True);
return;
end if;
end;
else
---------------------------------
-- Direct statement handling --
---------------------------------
if conn.direct_stmt_exec (stmt => Object.result_handle,
sql => Object.sql_final.all)
then
Object.log_nominal (category => logcat,
message => Object.sql_final.all);
case conn.examine_result (Object.result_handle) is
when CON.executed =>
Object.successful_execution := True;
when CON.returned_data =>
Object.successful_execution := True;
Object.insert_return := Object.insert_prepsql;
when CON.failed =>
Object.successful_execution := False;
end case;
if not Object.insert_return then
Object.size_of_rowset :=
conn.rows_in_result (Object.result_handle);
end if;
if Object.insert_return then
Object.last_inserted := conn.returned_id (Object.result_handle);
end if;
Object.scan_column_information (Object.result_handle);
Object.push_result_references (calls => Object.next_calls.all);
else
Object.log_problem
(category => statement_execution,
message => "Failed to execute a direct SQL query");
return;
end if;
end if;
end initialize;
-------------------------------
-- scan_column_information --
-------------------------------
procedure scan_column_information (Stmt : out PostgreSQL_statement;
pgresult : BND.PGresult_Access)
is
function fn (raw : String) return CT.Text;
function sn (raw : String) return String;
function fn (raw : String) return CT.Text is
begin
return CT.SUS (sn (raw));
end fn;
function sn (raw : String) return String is
begin
case Stmt.con_case_mode is
when upper_case =>
return ACH.To_Upper (raw);
when lower_case =>
return ACH.To_Lower (raw);
when natural_case =>
return raw;
end case;
end sn;
conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn;
begin
Stmt.num_columns := conn.fields_count (pgresult);
for index in Natural range 0 .. Stmt.num_columns - 1 loop
declare
info : column_info;
brec : bindrec;
name : String := conn.field_name (pgresult, index);
table : String := conn.field_table (pgresult, index);
begin
brec.v00 := False; -- placeholder
info.field_name := fn (name);
info.table := fn (table);
info.field_type := conn.field_type (pgresult, index);
info.binary_format := info.field_type = ft_chain;
Stmt.column_info.Append (New_Item => info);
-- The following pre-populates for bind support
Stmt.crate.Append (New_Item => brec);
Stmt.headings_map.Insert (Key => sn (name),
New_Item => Stmt.crate.Last_Index);
end;
end loop;
end scan_column_information;
-------------------
-- log_problem --
-------------------
procedure log_problem
(statement : PostgreSQL_statement;
category : Log_Category;
message : String;
pull_codes : Boolean := False;
break : Boolean := False)
is
error_msg : CT.Text := CT.blank;
error_code : Driver_Codes := 0;
sqlstate : SQL_State := stateless;
begin
if pull_codes then
error_msg := CT.SUS (statement.last_driver_message);
error_code := statement.last_driver_code;
sqlstate := statement.last_sql_state;
end if;
logger_access.all.log_problem
(driver => statement.dialect,
category => category,
message => CT.SUS ("PROBLEM: " & message),
error_msg => error_msg,
error_code => error_code,
sqlstate => sqlstate,
break => break);
end log_problem;
--------------
-- Adjust --
--------------
overriding
procedure Adjust (Object : in out PostgreSQL_statement) is
begin
-- The stmt object goes through this evolution:
-- A) created in private_prepare()
-- B) copied to new object in prepare(), A) destroyed
-- C) copied to new object in program, B) destroyed
-- We don't want to take any action until C) is destroyed, so add a
-- reference counter upon each assignment. When finalize sees a
-- value of "2", it knows it is the program-level statement and then
-- it can release memory releases, but not before!
Object.assign_counter := Object.assign_counter + 1;
-- Since the finalization is looking for a specific reference
-- counter, any further assignments would fail finalization, so
-- just prohibit them outright.
if Object.assign_counter > 2 then
raise STMT_PREPARATION
with "Statement objects cannot be re-assigned.";
end if;
end Adjust;
----------------
-- finalize --
----------------
overriding
procedure finalize (Object : in out PostgreSQL_statement)
is
conn : CON.PostgreSQL_Connection_Access renames Object.pgsql_conn;
name : constant String := Object.show_statement_name;
begin
if Object.assign_counter /= 2 then
return;
end if;
conn.discard_pgresult (Object.result_handle);
if Object.stmt_allocated then
if conn.autoCommit then
if not conn.destroy_statement (name) then
Object.log_problem
(category => statement_preparation,
message => "Deallocating statement resources: " & name,
pull_codes => True);
end if;
else
-- If we deallocate a prepared statement in the middle of a
-- transaction, the transaction is marked aborted, so we have
-- to postpone the deallocation until commit or rollback.
-- Morever, the connector needs to handle it so we don't have
-- to create variations of driver.commit and driver.rollback
conn.destroy_later (Object.identifier);
end if;
conn.discard_pgresult (Object.prepared_stmt);
end if;
if Object.sql_final /= null then
free_sql (Object.sql_final);
end if;
end finalize;
------------------------
-- assemble_datarow --
------------------------
function assemble_datarow (Stmt : out PostgreSQL_statement;
row_number : Trax_ID) return ARS.Datarow
is
function null_value (column : Natural) return Boolean;
function string_equivalent (column : Natural; binary : Boolean)
return String;
result : ARS.Datarow;
conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn;
maxlen : constant Natural := Natural (Stmt.column_info.Length);
function string_equivalent (column : Natural; binary : Boolean)
return String
is
-- PostgreSQL result set is zero-indexed
row_num : constant Natural := Natural (row_number) - 1;
col_num : constant Natural := column - 1;
begin
if binary then
return conn.field_chain (Stmt.result_handle, row_num, col_num,
Stmt.con_max_blob);
else
return conn.field_string (Stmt.result_handle, row_num, col_num);
end if;
end string_equivalent;
function null_value (column : Natural) return Boolean
is
-- PostgreSQL result set is zero-indexed
row_num : constant Natural := Natural (row_number) - 1;
col_num : constant Natural := column - 1;
begin
return conn.field_is_null (Stmt.result_handle, row_num, col_num);
end null_value;
begin
for F in 1 .. maxlen loop
declare
colinfo : column_info renames Stmt.column_info.Element (F);
field : ARF.Std_Field;
dvariant : ARF.Variant;
last_one : constant Boolean := (F = maxlen);
isnull : constant Boolean := null_value (F);
heading : constant String := CT.USS (colinfo.field_name);
ST : constant String :=
string_equivalent (F, colinfo.binary_format);
begin
if isnull then
field := ARF.spawn_null_field (colinfo.field_type);
else
case colinfo.field_type is
when ft_nbyte0 =>
dvariant := (datatype => ft_nbyte0, v00 => ST = "t");
when ft_nbyte1 =>
dvariant := (datatype => ft_nbyte1, v01 => convert (ST));
when ft_nbyte2 =>
dvariant := (datatype => ft_nbyte2, v02 => convert (ST));
when ft_nbyte3 =>
dvariant := (datatype => ft_nbyte3, v03 => convert (ST));
when ft_nbyte4 =>
dvariant := (datatype => ft_nbyte4, v04 => convert (ST));
when ft_nbyte8 =>
dvariant := (datatype => ft_nbyte8, v05 => convert (ST));
when ft_byte1 =>
dvariant := (datatype => ft_byte1, v06 => convert (ST));
when ft_byte2 =>
dvariant := (datatype => ft_byte2, v07 => convert (ST));
when ft_byte3 =>
dvariant := (datatype => ft_byte3, v08 => convert (ST));
when ft_byte4 =>
dvariant := (datatype => ft_byte4, v09 => convert (ST));
when ft_byte8 =>
dvariant := (datatype => ft_byte8, v10 => convert (ST));
when ft_real9 =>
dvariant := (datatype => ft_real9, v11 => convert (ST));
when ft_real18 =>
dvariant := (datatype => ft_real18, v12 => convert (ST));
when ft_textual =>
dvariant := (datatype => ft_textual, v13 => CT.SUS (ST));
when ft_widetext =>
dvariant := (datatype => ft_widetext, v14 => convert (ST));
when ft_supertext =>
dvariant := (datatype => ft_supertext, v15 => convert (ST));
when ft_utf8 =>
dvariant := (datatype => ft_utf8, v21 => CT.SUS (ST));
when ft_geometry =>
dvariant := (datatype => ft_geometry,
v22 => CT.SUS (postgis_to_WKB (ST)));
when ft_timestamp =>
begin
dvariant := (datatype => ft_timestamp,
v16 => ARC.convert (ST));
exception
when AR.CONVERSION_FAILED =>
dvariant := (datatype => ft_textual,
v13 => CT.SUS (ST));
end;
when ft_enumtype =>
dvariant := (datatype => ft_enumtype,
V18 => ARC.convert (CT.SUS (ST)));
when ft_chain => null;
when ft_settype => null;
when ft_bits => null;
end case;
case colinfo.field_type is
when ft_chain =>
field := ARF.spawn_field (binob => ARC.convert (ST));
when ft_bits =>
field := ARF.spawn_bits_field (ST);
when ft_settype =>
field := ARF.spawn_field (enumset => ST);
when others =>
field := ARF.spawn_field (data => dvariant,
null_data => isnull);
end case;
end if;
result.push (heading => heading,
field => field,
last_field => last_one);
end;
end loop;
if Stmt.result_arrow = Stmt.size_of_rowset then
conn.discard_pgresult (Stmt.result_handle);
end if;
return result;
end assemble_datarow;
---------------------------
-- show_statement_name --
---------------------------
function show_statement_name (Stmt : PostgreSQL_statement) return String is
begin
-- This is not documented, but the name has to be all lower case.
-- This nugget was responsible for hours of tracking down
-- prepared statement deallocation errors.
return "adabase_" & CT.trim (Stmt.identifier'Img);
end show_statement_name;
-----------------------
-- bind_text_value --
-----------------------
function bind_text_value (Stmt : PostgreSQL_statement; marker : Positive)
return AR.Textual
is
zone : bindrec renames Stmt.realmccoy.Element (marker);
vartype : constant field_types := zone.output_type;
use type AR.NByte0_Access;
use type AR.NByte1_Access;
use type AR.NByte2_Access;
use type AR.NByte3_Access;
use type AR.NByte4_Access;
use type AR.NByte8_Access;
use type AR.Byte1_Access;
use type AR.Byte2_Access;
use type AR.Byte3_Access;
use type AR.Byte4_Access;
use type AR.Byte8_Access;
use type AR.Real9_Access;
use type AR.Real18_Access;
use type AR.Str1_Access;
use type AR.Str2_Access;
use type AR.Str4_Access;
use type AR.Time_Access;
use type AR.Enum_Access;
use type AR.Chain_Access;
use type AR.Settype_Access;
use type AR.Bits_Access;
use type AR.S_UTF8_Access;
use type AR.Geometry_Access;
hold : AR.Textual;
begin
case vartype is
when ft_nbyte0 =>
if zone.a00 = null then
hold := ARC.convert (zone.v00);
else
hold := ARC.convert (zone.a00.all);
end if;
when ft_nbyte1 =>
if zone.a01 = null then
hold := ARC.convert (zone.v01);
else
hold := ARC.convert (zone.a01.all);
end if;
when ft_nbyte2 =>
if zone.a02 = null then
hold := ARC.convert (zone.v02);
else
hold := ARC.convert (zone.a02.all);
end if;
when ft_nbyte3 =>
if zone.a03 = null then
hold := ARC.convert (zone.v03);
else
hold := ARC.convert (zone.a03.all);
end if;
when ft_nbyte4 =>
if zone.a04 = null then
hold := ARC.convert (zone.v04);
else
hold := ARC.convert (zone.a04.all);
end if;
when ft_nbyte8 =>
if zone.a05 = null then
hold := ARC.convert (zone.v05);
else
hold := ARC.convert (zone.a05.all);
end if;
when ft_byte1 =>
if zone.a06 = null then
hold := ARC.convert (zone.v06);
else
hold := ARC.convert (zone.a06.all);
end if;
when ft_byte2 =>
if zone.a07 = null then
hold := ARC.convert (zone.v07);
else
hold := ARC.convert (zone.a07.all);
end if;
when ft_byte3 =>
if zone.a08 = null then
hold := ARC.convert (zone.v08);
else
hold := ARC.convert (zone.a08.all);
end if;
when ft_byte4 =>
if zone.a09 = null then
hold := ARC.convert (zone.v09);
else
hold := ARC.convert (zone.a09.all);
end if;
when ft_byte8 =>
if zone.a10 = null then
hold := ARC.convert (zone.v10);
else
hold := ARC.convert (zone.a10.all);
end if;
when ft_real9 =>
if zone.a11 = null then
hold := ARC.convert (zone.v11);
else
hold := ARC.convert (zone.a11.all);
end if;
when ft_real18 =>
if zone.a12 = null then
hold := ARC.convert (zone.v12);
else
hold := ARC.convert (zone.a12.all);
end if;
when ft_textual =>
if zone.a13 = null then
hold := zone.v13;
else
hold := zone.a13.all;
end if;
when ft_widetext =>
if zone.a14 = null then
hold := ARC.convert (zone.v14);
else
hold := ARC.convert (zone.a14.all);
end if;
when ft_supertext =>
if zone.a15 = null then
hold := ARC.convert (zone.v15);
else
hold := ARC.convert (zone.a15.all);
end if;
when ft_timestamp =>
if zone.a16 = null then
hold := ARC.convert (zone.v16);
else
hold := ARC.convert (zone.a16.all);
end if;
when ft_chain =>
if zone.a17 = null then
hold := zone.v17;
else
hold := ARC.convert (zone.a17.all);
end if;
when ft_enumtype =>
if zone.a18 = null then
hold := ARC.convert (zone.v18);
else
hold := ARC.convert (zone.a18.all);
end if;
when ft_settype =>
if zone.a19 = null then
hold := zone.v19;
else
hold := ARC.convert (zone.a19.all);
end if;
when ft_bits =>
if zone.a20 = null then
hold := zone.v20;
else
hold := ARC.convert (zone.a20.all);
end if;
when ft_utf8 =>
if zone.a21 = null then
hold := zone.v21;
else
hold := CT.SUS (zone.a21.all);
end if;
when ft_geometry =>
if zone.a22 = null then
hold := CT.SUS (WKB.produce_WKT (zone.v22));
else
hold := CT.SUS (Spatial_Data.Well_Known_Text (zone.a22.all));
end if;
end case;
return hold;
end bind_text_value;
---------------------------
-- returned_refcursors --
---------------------------
function returned_refcursors (Stmt : PostgreSQL_statement)
return Boolean
is
conn : CON.PostgreSQL_Connection_Access renames Stmt.pgsql_conn;
begin
return Stmt.size_of_rowset > 0 and then
conn.holds_refcursor (Stmt.result_handle, 0);
end returned_refcursors;
--------------------------------
-- pop_result_set_reference --
--------------------------------
function pop_result_set_reference (Stmt : out PostgreSQL_statement)
return String
is
begin
if Stmt.refcursors.Is_Empty then
return "";
end if;
declare
answer : String := CT.USS (Stmt.refcursors.First_Element.payload);
begin
Stmt.refcursors.Delete_First;
return answer;
end;
end pop_result_set_reference;
------------------------------
-- push_result_references --
------------------------------
procedure push_result_references (Stmt : out PostgreSQL_statement;
calls : String)
is
items : Natural;
base : Natural;
begin
if CT.IsBlank (calls) then
return;
end if;
items := CT.num_set_items (calls);
if items = 1 then
Stmt.refcursors.Append ((payload => CT.SUS (calls)));
else
base := calls'First;
for x in Natural range 1 .. items - 1 loop
for y in Natural range base .. calls'Last loop
if calls (y) = ',' then
declare
len : Natural := y - base;
Str : String (1 .. len) := calls (base .. y - 1);
begin
Stmt.refcursors.Append ((payload => CT.SUS (Str)));
base := y + 1;
end;
exit;
end if;
end loop;
end loop;
declare
len : Natural := calls'Last + 1 - base;
Str : String (1 .. len) := calls (base .. calls'Last);
begin
Stmt.refcursors.Append ((payload => CT.SUS (Str)));
end;
end if;
end push_result_references;
----------------------
-- postgis_to_WKB --
----------------------
function postgis_to_WKB (postgis : String) return String
is
subtype hex_type is String (1 .. 2);
function hex2char (hex : hex_type) return Character;
-- Postgis is a string of hexidecimal values (e.g. 0 .. F)
-- position 01-02 = endian (1 byte)
-- position 03-04 = WKB type (1 byte, not 4 bytes)
-- position 05-10 - internal, ignore (3 bytes)
-- position 11-18 - SRID, ignore, 4 bytes
-- position 19+ is stock WKB.
-- Must always be evenly numbered (2 digits per byte)
function hex2char (hex : hex_type) return Character
is
sixt : Character renames hex (1);
ones : Character renames hex (2);
zero : Natural := Character'Pos ('0');
alpha : Natural := Character'Pos ('A');
val : Natural;
begin
case sixt is
when '0' .. '9' =>
val := 16 * (Character'Pos (sixt) - zero);
when 'A' .. 'F' =>
val := 16 * (10 + Character'Pos (sixt) - alpha);
when others =>
raise POSTGIS_READ_ERROR
with "hex (1) invalid character: " & sixt;
end case;
case ones is
when '0' .. '9' =>
val := val + (Character'Pos (ones) - zero);
when 'A' .. 'F' =>
val := val + (10 + Character'Pos (ones) - alpha);
when others =>
raise POSTGIS_READ_ERROR
with "hex (2) invalid character: " & ones;
end case;
return Character'Val (val);
end hex2char;
output_size : constant Natural := (postgis'Length / 2) - 4;
wkb_string : String (1 .. output_size) := (others => ASCII.NUL);
canvas : String (1 .. postgis'Length) := postgis;
endian_sign : constant hex_type := canvas (1 .. 2);
geom_type : constant hex_type := canvas (3 .. 4);
begin
wkb_string (1) := hex2char (endian_sign);
if Character'Pos (wkb_string (1)) = 1 then
-- little endian
wkb_string (2) := hex2char (geom_type);
else
-- big endian
wkb_string (5) := hex2char (geom_type);
end if;
for chunk in 6 .. output_size loop
wkb_string (chunk) :=
hex2char (canvas ((chunk * 2) + 7 .. (chunk * 2) + 8));
end loop;
return wkb_string;
end postgis_to_WKB;
end AdaBase.Statement.Base.PostgreSQL;
|
------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- A D A . I N T E R R U P T S . N A M E S --
-- --
-- S p e c --
-- --
-- --
-- Copyright (C) 1991-2002 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, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This is a NetBSD version of this package.
--
with System.OS_Interface;
-- used for names of interrupts
package Ada.Interrupts.Names is
-- Beware that the mapping of names to signals may be
-- many-to-one. There may be aliases. Also, for all
-- signal names that are not supported on the current system
-- the value of the corresponding constant will be zero.
Sighup : constant Interrupt_ID := System.OS_Interface.sighup;
-- hangup
Sigint : constant Interrupt_ID := System.OS_Interface.sigint;
-- interrupt (rubout)
Sigquit : constant Interrupt_ID := System.OS_Interface.sigquit;
-- quit (ASCD FS)
Sigill : constant Interrupt_ID := System.OS_Interface.sigill;
-- illegal instruction (not reset)
Sigtrap : constant Interrupt_ID := System.OS_Interface.sigtrap;
-- trace trap (not reset)
Sigiot : constant Interrupt_ID := System.OS_Interface.sigiot;
-- IOT instruction
SIGABRT : constant Interrupt_ID := System.OS_Interface.SIGABRT;
-- used by abort,-- replace SIGIOT in the future
Sigemt : constant Interrupt_ID := System.OS_Interface.sigemt;
-- EMT instruction
Sigfpe : constant Interrupt_ID := System.OS_Interface.sigfpe;
-- floating point exception
Sigkill : constant Interrupt_ID := System.OS_Interface.sigkill;
-- kill (cannot be caught or ignored)
Sigbus : constant Interrupt_ID := System.OS_Interface.sigbus;
-- bus error
Sigsegv : constant Interrupt_ID := System.OS_Interface.sigsegv;
-- segmentation violation
Sigsys : constant Interrupt_ID := System.OS_Interface.sigsys;
-- bad argument to system call
Sigpipe : constant Interrupt_ID := System.OS_Interface.sigpipe;
-- write on a pipe with-- no one to read it
Sigalrm : constant Interrupt_ID := System.OS_Interface.sigalrm;
-- alarm clock
Sigterm : constant Interrupt_ID := System.OS_Interface.sigterm;
-- software termination signal from kill
Sigusr1 : constant Interrupt_ID := System.OS_Interface.sigusr1;
-- user defined signal 1
Sigusr2 : constant Interrupt_ID := System.OS_Interface.sigusr2;
-- user defined signal 2
Sigcld : constant Interrupt_ID := System.OS_Interface.sigchld;
-- child status change
Sigchld : constant Interrupt_ID := System.OS_Interface.sigchld;
-- 4.3BSD's/POSIX name for SIGCLD
Sigwinch : constant Interrupt_ID := System.OS_Interface.sigwinch;
-- window size change
Sigurg : constant Interrupt_ID := System.OS_Interface.sigurg;
-- urgent condition on IO channel
Sigpoll : constant Interrupt_ID := System.OS_Interface.sigio;
-- pollable event occurred
Sigio : constant Interrupt_ID := System.OS_Interface.sigio;
-- input/output possible,-- SIGPOLL alias (Solaris)
Sigstop : constant Interrupt_ID := System.OS_Interface.sigstop;
-- stop (cannot be caught or ignored)
Sigtstp : constant Interrupt_ID := System.OS_Interface.sigtstp;
-- user stop requested from tty
Sigcont : constant Interrupt_ID := System.OS_Interface.sigcont;
-- stopped process has been continued
Sigttin : constant Interrupt_ID := System.OS_Interface.sigttin;
-- background tty read attempted
Sigttou : constant Interrupt_ID := System.OS_Interface.sigttou;
-- background tty write attempted
Sigvtalrm : constant Interrupt_ID := System.OS_Interface.sigvtalrm;
-- virtual timer expired
Sigprof : constant Interrupt_ID := System.OS_Interface.sigprof;
-- profiling timer expired
Sigxcpu : constant Interrupt_ID := System.OS_Interface.sigxcpu;
-- CPU time limit exceeded
Sigxfsz : constant Interrupt_ID := System.OS_Interface.sigxfsz;
-- filesize limit exceeded
Sigpwr : constant Interrupt_ID := System.OS_Interface.sigpwr;
-- power-fail restart
Siginfo : constant Interrupt_ID := System.OS_Interface.siginfo;
end Ada.Interrupts.Names;
|
-- Copyright 2011-2016 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with System;
package Pck is
procedure Do_Nothing (A : System.Address);
function Foos return String;
end Pck;
|
-- Copyright 2008-2014 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/>.
-- Test Ada additions to core GDB evaluation.
with System;
with Text_IO; use Text_IO;
procedure P is
type Int is range System.Min_Int .. System.Max_Int;
X, Z : Int;
Y : Integer;
begin
X := 0;
-- Set X to 7 by disguised means lest a future optimizer interfere.
for I in 1 .. 7 loop
X := X + 1;
end loop;
Z := 1;
Y := 0;
while Z < Int'Last / X loop
Z := Z * X;
Y := Y + 1;
end loop;
Put_Line (Int'Image (X ** Y)); -- START
end P;
|
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with AUnit.Assertions; use AUnit.Assertions;
with Rejuvenation.String_Utils; use Rejuvenation.String_Utils;
package body Test_String_Utils is
Prefix : constant String := "Prefix";
New_Prefix : constant String := "New_Prefix";
Remainder : constant String := "Remainder";
Empty : constant String := "";
procedure TestCase (Prefix, New_Prefix, Remainder : String);
procedure TestCase (Prefix, New_Prefix, Remainder : String) is
begin
Assert
(Actual =>
Replace_Prefix
(String_With_Prefix => Prefix & Remainder,
Prefix => Prefix,
New_Prefix => New_Prefix),
Expected => New_Prefix & Remainder,
Message =>
"Substitution failed with" & ASCII.LF &
"Prefix => " & Prefix & ASCII.LF &
"New_Prefix => " & New_Prefix & ASCII.LF &
"Remainder => " & Remainder & ASCII.LF);
end TestCase;
procedure Test_example (T : in out Test_Case'Class);
procedure Test_example (T : in out Test_Case'Class) is
pragma Unreferenced (T);
begin
TestCase (Prefix, New_Prefix, Remainder);
end Test_example;
procedure Test_new_prefix_same_size
(T : in out Test_Case'Class);
procedure Test_new_prefix_same_size
(T : in out Test_Case'Class)
is
pragma Unreferenced (T);
Same_Size_Prefix : constant String := Prefix'Length * "A";
begin
Assert
(Condition => Same_Size_Prefix'Length = Prefix'Length,
Message => "Test precondition not realized");
TestCase (Prefix, Same_Size_Prefix, Remainder);
end Test_new_prefix_same_size;
procedure Test_new_prefix_longer
(T : in out Test_Case'Class);
procedure Test_new_prefix_longer (T : in out Test_Case'Class)
is
pragma Unreferenced (T);
Longer_Prefix : constant String := "Longer_Prefix";
begin
Assert
(Condition => Longer_Prefix'Length > Prefix'Length,
Message => "Test precondition not realized");
TestCase (Prefix, Longer_Prefix, Remainder);
end Test_new_prefix_longer;
procedure Test_new_prefix_shorter
(T : in out Test_Case'Class);
procedure Test_new_prefix_shorter
(T : in out Test_Case'Class)
is
pragma Unreferenced (T);
Shorter_Prefix : constant String := "SP"; -- Shorter Prefix
begin
Assert
(Condition => Shorter_Prefix'Length < Prefix'Length,
Message => "Test precondition not realized");
TestCase (Prefix, Shorter_Prefix, Remainder);
end Test_new_prefix_shorter;
procedure Test_slices (T : in out Test_Case'Class);
procedure Test_slices (T : in out Test_Case'Class) is
pragma Unreferenced (T);
begin
TestCase (Prefix (3 .. 5), New_Prefix (6 .. 8), Remainder (2 .. 4));
end Test_slices;
procedure Test_empty_prefix (T : in out Test_Case'Class);
procedure Test_empty_prefix (T : in out Test_Case'Class) is
pragma Unreferenced (T);
begin
TestCase (Empty, New_Prefix, Remainder);
end Test_empty_prefix;
procedure Test_empty_new_prefix
(T : in out Test_Case'Class);
procedure Test_empty_new_prefix (T : in out Test_Case'Class)
is
pragma Unreferenced (T);
begin
TestCase (Prefix, Empty, Remainder);
end Test_empty_new_prefix;
procedure Test_empty_remainder (T : in out Test_Case'Class);
procedure Test_empty_remainder (T : in out Test_Case'Class)
is
pragma Unreferenced (T);
begin
TestCase (Prefix, New_Prefix, Empty);
end Test_empty_remainder;
procedure Test_empty_prefix_and_new_prefix
(T : in out Test_Case'Class);
procedure Test_empty_prefix_and_new_prefix
(T : in out Test_Case'Class)
is
pragma Unreferenced (T);
begin
TestCase (Empty, Empty, Remainder);
end Test_empty_prefix_and_new_prefix;
procedure Test_empty_prefix_and_remainder
(T : in out Test_Case'Class);
procedure Test_empty_prefix_and_remainder
(T : in out Test_Case'Class)
is
pragma Unreferenced (T);
begin
TestCase (Empty, New_Prefix, Empty);
end Test_empty_prefix_and_remainder;
procedure Test_empty_new_prefix_and_remainder
(T : in out Test_Case'Class);
procedure Test_empty_new_prefix_and_remainder
(T : in out Test_Case'Class)
is
pragma Unreferenced (T);
begin
TestCase (Prefix, Empty, Empty);
end Test_empty_new_prefix_and_remainder;
procedure Test_all_empty (T : in out Test_Case'Class);
procedure Test_all_empty (T : in out Test_Case'Class)
is
pragma Unreferenced (T);
begin
TestCase (Empty, Empty, Empty);
end Test_all_empty;
-- Test plumbing
overriding function Name
(T : String_Utils_Test_Case) return AUnit.Message_String
is
pragma Unreferenced (T);
begin
return AUnit.Format ("String Utils");
end Name;
overriding procedure Register_Tests (T : in out String_Utils_Test_Case) is
begin
Registration.Register_Routine
(T, Test_example'Access, "Example");
Registration.Register_Routine
(T, Test_new_prefix_same_size'Access,
"New Prefix Same Size");
Registration.Register_Routine
(T, Test_new_prefix_longer'Access, "New Prefix Longer");
Registration.Register_Routine
(T, Test_new_prefix_shorter'Access,
"New Prefix Shorter");
Registration.Register_Routine
(T, Test_slices'Access, "Slices");
Registration.Register_Routine
(T, Test_empty_prefix'Access, "Empty Prefix");
Registration.Register_Routine
(T, Test_empty_new_prefix'Access, "Empty New Prefix");
Registration.Register_Routine
(T, Test_empty_remainder'Access, "Empty Remainder");
Registration.Register_Routine
(T, Test_empty_prefix_and_new_prefix'Access,
"Empty Prefix and New Prefix");
Registration.Register_Routine
(T, Test_empty_prefix_and_remainder'Access,
"Empty Prefix and Remainder");
Registration.Register_Routine
(T, Test_empty_new_prefix_and_remainder'Access,
"Empty New Prefix and Remainder");
Registration.Register_Routine
(T, Test_all_empty'Access, "All Empty");
end Register_Tests;
end Test_String_Utils;
|
------------------------------------------------------------------------------
-- --
-- ASIS-for-GNAT INTERFACE COMPONENTS --
-- --
-- A S I S . C L A U S E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2006-2012, Free Software Foundation, Inc. --
-- --
-- This specification is adapted from the Ada Semantic Interface --
-- Specification Standard (ISO/IEC 15291) for use with GNAT. In accordance --
-- with the copyright of that document, you can freely copy and modify this --
-- specification, provided that if you redistribute a modified version, any --
-- changes that you have made are clearly indicated. --
-- --
-- This specification also contains suggestions and discussion items --
-- related to revising the ASIS Standard according to the changes proposed --
-- for the new revision of the Ada standard. The copyright notice above, --
-- and the license provisions that follow apply solely to these suggestions --
-- and discussion items that are separated by the corresponding comment --
-- sentinels --
-- --
-- ASIS-for-GNAT is free software; you can redistribute it and/or modify it --
-- under terms of the GNU General Public License as published by the Free --
-- Software Foundation; either version 2, or (at your option) any later --
-- version. ASIS-for-GNAT is distributed in the hope that it will be use- --
-- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- --
-- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General --
-- Public License for more details. You should have received a copy of the --
-- GNU General Public License distributed with ASIS-for-GNAT; see file --
-- COPYING. If not, write to the Free Software Foundation, 51 Franklin --
-- Street, Fifth Floor, Boston, MA 02110-1301, USA. --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- --
-- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the --
-- Software Engineering Laboratory of the Swiss Federal Institute of --
-- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the --
-- Scientific Research Computer Center of Moscow State University (SRCC --
-- MSU), Russia, with funding partially provided by grants from the Swiss --
-- National Science Foundation and the Swiss Academy of Engineering --
-- Sciences. ASIS-for-GNAT is now maintained by AdaCore --
-- (http://www.adacore.com). --
-- --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- 19 package Asis.Clauses
-- Suggestions related to changing this specification to accept new Ada
-- features as defined in incoming revision of the Ada Standard (ISO 8652)
-- are marked by following comment sentinels:
--
-- --|A2005 start
-- ... the suggestion goes here ...
-- --|A2005 end
--
-- and the discussion items are marked by the comment sentinels of teh form:
--
-- --|D2005 start
-- ... the discussion item goes here ...
-- --|D2005 end
------------------------------------------------------------------------------
------------------------------------------------------------------------------
package Asis.Clauses is
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Asis.Clauses
--
-- This package encapsulates a set of queries that operate on A_Clause
-- elements.
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Use_Package_Clause - 8.4
-- --|ER A_Use_Type_Clause - 8.4
-- --|ER A_Use_All_Type_Clause - 8.4 -- Ada 2012
-- --|ER A_With_Clause - 10.1.2
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Clause_Names
-- --|CR
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- 19.1 function Clause_Names
------------------------------------------------------------------------------
function Clause_Names (Clause : Asis.Element) return Asis.Name_List;
------------------------------------------------------------------------------
-- Clause - Specifies the with_clause or use_clause to query
--
-- Returns a list of the names that appear in the given clause.
-- The names in the list should be in their order of appearance in the
-- original clauses from the compilation text.
--
-- Results of this query may vary across ASIS implementations. Some
-- implementations normalize all clauses containing multiple names
-- into an equivalent sequence of corresponding single clauses.
-- Similarly, an implementation may keep a name only once even though that
-- name can appear more than once in a clause.
--
-- Appropriate Element_Kinds:
-- A_Use_Package_Clause
-- A_Use_Type_Clause
-- A_Use_All_Type_Clause -- Ada 2012
-- A_With_Clause
--
-- Returns Expression_Kinds:
-- An_Identifier
-- A_Selected_Component
-- An_Attribute_Reference
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Representation_Clause - 13.1
-- --|ER---------------------------------------------------------------------
-- --|ER An_Attribute_Definition_Clause - 13.3
-- --|ER An_Enumeration_Representation_Clause - 13.4
-- --|ER An_At_Clause - J.7
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Representation_Clause_Name
-- --|CR function Representation_Clause_Expression
--
------------------------------------------------------------------------------
-- 19.2 function Representation_Clause_Name
------------------------------------------------------------------------------
function Representation_Clause_Name
(Clause : Asis.Clause)
return Asis.Name;
------------------------------------------------------------------------------
-- Clause - Specifies the representation_clause to query
--
-- Returns the direct_name expression following the reserved word "for".
--
-- |D2005 start
-- But A_Component_Clause does not have the reserved word "for"! The wording
-- needs revising!
-- |D2005 end
--
-- Appropriate Clause_Kinds:
-- A_Representation_Clause
-- A_Component_Clause
--
-- Returns Expression_Kinds:
-- An_Identifier
-- An_Attribute_Reference
--
------------------------------------------------------------------------------
-- 19.3 function Representation_Clause_Expression
------------------------------------------------------------------------------
function Representation_Clause_Expression
(Clause : Asis.Representation_Clause)
return Asis.Expression;
------------------------------------------------------------------------------
-- Clause - Specifies the representation_clause to query
--
-- Returns the expression following the reserved word "use" or the reserved
-- words "use at".
--
-- Appropriate Representation_Clause_Kinds:
-- An_Attribute_Definition_Clause
-- An_Enumeration_Representation_Clause
-- An_At_Clause
--
-- Returns Element_Kinds:
-- An_Expression
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Record_Representation_Clause - 13.5.1
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Representation_Clause_Name
-- --|CR function Mod_Clause_Expression
-- --|CR function Component_Clauses
--
------------------------------------------------------------------------------
-- 19.4 function Mod_Clause_Expression
------------------------------------------------------------------------------
function Mod_Clause_Expression
(Clause : Asis.Representation_Clause)
return Asis.Expression;
------------------------------------------------------------------------------
-- Clause - Specifies the record representation clause to query
--
-- Returns the static_expression appearing after the reserved words "at mod".
--
-- Returns a Nil_Element if a mod_clause is not present.
--
-- Appropriate Representation_Clause_Kinds:
-- A_Record_Representation_Clause
--
-- Returns Element_Kinds:
-- Not_An_Element
-- An_Expression
--
------------------------------------------------------------------------------
-- 19.5 function Component_Clauses
------------------------------------------------------------------------------
function Component_Clauses
(Clause : Asis.Representation_Clause;
Include_Pragmas : Boolean := False)
return Asis.Component_Clause_List;
------------------------------------------------------------------------------
-- Clause - Specifies the record representation clause to query
-- Include_Pragmas - Specifies whether pragmas are to be returned
--
-- Returns the component_clause and pragma elements from the
-- record_representation_clause, in their order of appearance.
--
-- Returns a Nil_Element_List if the record_representation_clause has no
-- component_clause or pragma elements.
--
-- Appropriate Representation_Clause_Kinds:
-- A_Record_Representation_Clause
--
-- Returns Element_Kinds:
-- A_Clause
-- A_Pragma
--
-- Returns Clause_Kinds:
-- A_Component_Clause
--
-- --|ER---------------------------------------------------------------------
-- --|ER A_Component_Clause - 13.5.1
-- --|CR
-- --|CR Child elements returned by:
-- --|CR function Representation_Clause_Name
-- --|CR function Component_Clause_Position
-- --|CR function Component_Clause_Range
--
------------------------------------------------------------------------------
-- 19.6 function Component_Clause_Position
------------------------------------------------------------------------------
function Component_Clause_Position
(Clause : Asis.Component_Clause)
return Asis.Expression;
------------------------------------------------------------------------------
-- Clause - Specifies the component_clause to query
--
-- Returns the position expression for the component_clause.
--
-- Appropriate Clause_Kinds:
-- A_Component_Clause
--
-- Returns Element_Kinds:
-- An_Expression
--
------------------------------------------------------------------------------
-- 19.7 function Component_Clause_Range
------------------------------------------------------------------------------
function Component_Clause_Range
(Clause : Asis.Component_Clause)
return Asis.Discrete_Range;
------------------------------------------------------------------------------
-- Clause - Specifies the component_clause to query
--
-- Returns the first_bit .. last_bit range for the component_clause.
--
-- Appropriate Clause_Kinds:
-- A_Component_Clause
--
-- Returns Discrete_Range_Kinds:
-- A_Discrete_Simple_Expression_Range
--
------------------------------------------------------------------------------
end Asis.Clauses;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY COMPONENTS --
-- --
-- S Y S T E M . C O M P A R E _ A R R A Y _ S I G N E D _ 1 6 --
-- --
-- B o d y --
-- --
-- Copyright (C) 2002-2021, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.Address_Operations; use System.Address_Operations;
with Ada.Unchecked_Conversion;
package body System.Compare_Array_Signed_16 is
type Word is mod 2 ** 32;
-- Used to process operands by words
type Half is range -(2 ** 15) .. (2 ** 15) - 1;
for Half'Size use 16;
-- Used to process operands by half words
type Uhalf is new Half;
for Uhalf'Alignment use 1;
-- Used to process operands when unaligned
type WP is access Word;
type HP is access Half;
type UP is access Uhalf;
function W is new Ada.Unchecked_Conversion (Address, WP);
function H is new Ada.Unchecked_Conversion (Address, HP);
function U is new Ada.Unchecked_Conversion (Address, UP);
-----------------------
-- Compare_Array_S16 --
-----------------------
function Compare_Array_S16
(Left : System.Address;
Right : System.Address;
Left_Len : Natural;
Right_Len : Natural) return Integer
is
Clen : Natural := Natural'Min (Left_Len, Right_Len);
-- Number of elements left to compare
L : Address := Left;
R : Address := Right;
-- Pointers to next elements to compare
begin
-- Go by words if possible
if ModA (OrA (Left, Right), 4) = 0 then
while Clen > 1
and then W (L).all = W (R).all
loop
Clen := Clen - 2;
L := AddA (L, 4);
R := AddA (R, 4);
end loop;
end if;
-- Case of going by aligned half words
if ModA (OrA (Left, Right), 2) = 0 then
while Clen /= 0 loop
if H (L).all /= H (R).all then
if H (L).all > H (R).all then
return +1;
else
return -1;
end if;
end if;
Clen := Clen - 1;
L := AddA (L, 2);
R := AddA (R, 2);
end loop;
-- Case of going by unaligned half words
else
while Clen /= 0 loop
if U (L).all /= U (R).all then
if U (L).all > U (R).all then
return +1;
else
return -1;
end if;
end if;
Clen := Clen - 1;
L := AddA (L, 2);
R := AddA (R, 2);
end loop;
end if;
-- Here if common section equal, result decided by lengths
if Left_Len = Right_Len then
return 0;
elsif Left_Len > Right_Len then
return +1;
else
return -1;
end if;
end Compare_Array_S16;
end System.Compare_Array_Signed_16;
|
pragma Ada_2012;
pragma Style_Checks (Off);
with Interfaces.C; use Interfaces.C;
with bits_types_h;
package sys_types_h is
-- Copyright (C) 1991-2021 Free Software Foundation, Inc.
-- This file is part of the GNU C Library.
-- The GNU C Library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 of the License, or (at your option) any later version.
-- The GNU C Library 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
-- Lesser General Public License for more details.
-- You should have received a copy of the GNU Lesser General Public
-- License along with the GNU C Library; if not, see
-- <https://www.gnu.org/licenses/>.
-- * POSIX Standard: 2.6 Primitive System Data Types <sys/types.h>
--
subtype u_char is bits_types_h.uu_u_char; -- /usr/include/sys/types.h:33
subtype u_short is bits_types_h.uu_u_short; -- /usr/include/sys/types.h:34
subtype u_int is bits_types_h.uu_u_int; -- /usr/include/sys/types.h:35
subtype u_long is bits_types_h.uu_u_long; -- /usr/include/sys/types.h:36
subtype quad_t is bits_types_h.uu_quad_t; -- /usr/include/sys/types.h:37
subtype u_quad_t is bits_types_h.uu_u_quad_t; -- /usr/include/sys/types.h:38
subtype fsid_t is bits_types_h.uu_fsid_t; -- /usr/include/sys/types.h:39
subtype loff_t is bits_types_h.uu_loff_t; -- /usr/include/sys/types.h:42
subtype ino_t is bits_types_h.uu_ino_t; -- /usr/include/sys/types.h:47
subtype ino64_t is bits_types_h.uu_ino64_t; -- /usr/include/sys/types.h:54
subtype dev_t is bits_types_h.uu_dev_t; -- /usr/include/sys/types.h:59
subtype gid_t is bits_types_h.uu_gid_t; -- /usr/include/sys/types.h:64
subtype mode_t is bits_types_h.uu_mode_t; -- /usr/include/sys/types.h:69
subtype nlink_t is bits_types_h.uu_nlink_t; -- /usr/include/sys/types.h:74
subtype uid_t is bits_types_h.uu_uid_t; -- /usr/include/sys/types.h:79
subtype off_t is bits_types_h.uu_off_t; -- /usr/include/sys/types.h:85
subtype off64_t is bits_types_h.uu_off64_t; -- /usr/include/sys/types.h:92
subtype pid_t is bits_types_h.uu_pid_t; -- /usr/include/sys/types.h:97
subtype id_t is bits_types_h.uu_id_t; -- /usr/include/sys/types.h:103
subtype ssize_t is bits_types_h.uu_ssize_t; -- /usr/include/sys/types.h:108
subtype daddr_t is bits_types_h.uu_daddr_t; -- /usr/include/sys/types.h:114
subtype caddr_t is bits_types_h.uu_caddr_t; -- /usr/include/sys/types.h:115
subtype key_t is bits_types_h.uu_key_t; -- /usr/include/sys/types.h:121
subtype useconds_t is bits_types_h.uu_useconds_t; -- /usr/include/sys/types.h:134
subtype suseconds_t is bits_types_h.uu_suseconds_t; -- /usr/include/sys/types.h:138
-- Old compatibility names for C types.
subtype ulong is unsigned_long; -- /usr/include/sys/types.h:148
subtype ushort is unsigned_short; -- /usr/include/sys/types.h:149
subtype uint is unsigned; -- /usr/include/sys/types.h:150
-- These size-specific names are used by some of the inet code.
-- These were defined by ISO C without the first `_'.
subtype u_int8_t is bits_types_h.uu_uint8_t; -- /usr/include/sys/types.h:158
subtype u_int16_t is bits_types_h.uu_uint16_t; -- /usr/include/sys/types.h:159
subtype u_int32_t is bits_types_h.uu_uint32_t; -- /usr/include/sys/types.h:160
subtype u_int64_t is bits_types_h.uu_uint64_t; -- /usr/include/sys/types.h:161
subtype register_t is long; -- /usr/include/sys/types.h:164
-- Some code from BIND tests this macro to see if the types above are
-- defined.
-- In BSD <sys/types.h> is expected to define BYTE_ORDER.
-- It also defines `fd_set' and the FD_* macros for `select'.
subtype blksize_t is bits_types_h.uu_blksize_t; -- /usr/include/sys/types.h:185
-- Types from the Large File Support interface.
-- Type to count number of disk blocks.
subtype blkcnt_t is bits_types_h.uu_blkcnt_t; -- /usr/include/sys/types.h:192
-- Type to count file system blocks.
subtype fsblkcnt_t is bits_types_h.uu_fsblkcnt_t; -- /usr/include/sys/types.h:196
-- Type to count file system inodes.
subtype fsfilcnt_t is bits_types_h.uu_fsfilcnt_t; -- /usr/include/sys/types.h:200
-- Type to count number of disk blocks.
-- Type to count file system blocks.
-- Type to count file system inodes.
-- Type to count number of disk blocks.
subtype blkcnt64_t is bits_types_h.uu_blkcnt64_t; -- /usr/include/sys/types.h:219
-- Type to count file system blocks.
subtype fsblkcnt64_t is bits_types_h.uu_fsblkcnt64_t; -- /usr/include/sys/types.h:220
-- Type to count file system inodes.
subtype fsfilcnt64_t is bits_types_h.uu_fsfilcnt64_t; -- /usr/include/sys/types.h:221
-- Now add the thread types.
end sys_types_h;
|
with Ada.Containers.Vectors;
use Ada.Containers;
with Memory; use Memory;
with Memory.Wrapper; use Memory.Wrapper;
with Lexer; use Lexer;
-- Package to handle parsing memory descriptions.
package Parser is
type Parser_Type is limited private;
-- Parse the memory description in the specified file.
function Parse(file_name : String) return Memory_Pointer;
private
-- Exception for parse errors.
Parse_Error : exception;
-- Type to represent a wrapper.
-- A wrapper is a memory component that fully contains one
-- or more memory components.
type Wrapper_Node is record
wrapper : Wrapper_Pointer;
current : Natural := 0;
last : Natural := 0;
end record;
-- Stack of wrappers.
package Wrapper_Vectors is new Vectors(Natural, Wrapper_Node);
type Parser_Type is limited record
lexer : Lexer_Type;
wrappers : Wrapper_Vectors.Vector;
end record;
-- Raise a parser error with the specified message.
procedure Raise_Error(parser : in Parser_Type;
msg : in String);
-- Get the current token type.
function Get_Type(parser : Parser_Type) return Token_Type;
-- Get the current token value.
function Get_Value(parser : Parser_Type) return String;
-- Match the current token and move to the next.
procedure Match(parser : in out Parser_Type;
token : in Token_Type);
-- Parse a "true"/"false" string.
function Parse_Boolean(value : String) return Boolean;
-- Parse a memory subsystem.
procedure Parse_Memory(parser : in out Parser_Type;
result : out Memory_Pointer);
-- Push a wrapper onto the stack.
procedure Push_Wrapper(parser : in out Parser_Type;
wrapper : in Wrapper_Pointer;
count : in Positive := 1);
-- Pop a wrapper off of the stack.
procedure Pop_Wrapper(parser : in out Parser_Type;
wrapper : out Wrapper_Pointer;
index : out Natural);
-- Delete the top wrapper.
procedure Delete_Wrapper(parser : in out Parser_Type);
end Parser;
|
-- Copyright 2018-2021 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Enum_With_Gap; use Enum_With_Gap;
procedure Enum_With_Gap_Main is
Indexed_By_Enum : AR_Access :=
new AR'(LIT1 => 1, LIT2 => 43, LIT3 => 42, LIT4 => 41);
S : String_Access := new String'("Hello!");
V : Enum_Subrange := LIT3;
begin
Do_Nothing (Indexed_By_Enum); -- BREAK
Do_Nothing (S);
end Enum_With_Gap_Main;
|
-------------------------------------------------------------------------------
-- Copyright 2021, The Septum Developers (see AUTHORS file)
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
-- http://www.apache.org/licenses/LICENSE-2.0
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-------------------------------------------------------------------------------
with Ada.Strings.Unbounded;
with ANSI;
with System;
with Trendy_Terminal.IO;
with Trendy_Terminal.VT100;
package SP.Terminal is
-- Functions for operations to the terminal. This hides the usage of Ada.Text_IO and may silently ignore
-- capabilities if the terminal does not support them, such as if coloring text or line clearing is added.
--
-- This module also hides dependencies on unbounded IO.
procedure Put (C : Character) renames Trendy_Terminal.IO.Put;
procedure Put (Str : String) renames Trendy_Terminal.IO.Put;
procedure Put (Str : Ada.Strings.Unbounded.Unbounded_String) renames Trendy_Terminal.IO.Put;
procedure Put_Line (Str : String) renames Trendy_Terminal.IO.Put_Line;
procedure Put_Line (Str : Ada.Strings.Unbounded.Unbounded_String) renames Trendy_Terminal.IO.Put_Line;
procedure New_Line (Spacing : Positive := 1) renames Trendy_Terminal.IO.New_Line;
procedure Set_Col (Spacing : Positive) renames Trendy_Terminal.IO.Set_Col;
procedure Beginning_Of_Line renames Trendy_Terminal.VT100.Beginning_Of_Line;
procedure Clear_Line renames Trendy_Terminal.VT100.Clear_Line;
function Colorize (S : String; Color : ANSI.Colors) return String;
function Colorize (US : Ada.Strings.Unbounded.Unbounded_String; Color : ANSI.Colors)
return Ada.Strings.Unbounded.Unbounded_String;
-- I'm not convinced that these aren't useful. I haven't figured out how best to deal with the really long and
-- verbose terminology of Ada.Strings.Unbounded.Unbounded_String.
-- function "&" (A : String; B : Unbounded_String) return Unbounded_String renames Ada.Strings.Unbounded."&";
-- function "&" (Ada : Unbounded_String; B : String) return Unbounded_String renames Ada.Strings.Unbounded."&";
type FILE_Ptr is new System.Address;
stdin : FILE_Ptr;
pragma Import (C, stdin, "stdin");
-- stdio.h
procedure clearerr (Stream : FILE_Ptr);
pragma Import (C, clearerr, "clearerr");
protected type Cancellation_Gate is
entry Closed;
procedure Finish;
procedure Cancel;
function Is_Cancelled return Boolean;
function Is_Finished return Boolean;
private
Cancelled : Boolean := False;
Finished : Boolean := False;
end Cancellation_Gate;
task type Terminal_Cancellation_Monitor(Gate : not null access Cancellation_Gate) is
entry Cancel;
entry Stop;
end;
end SP.Terminal;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T . S T R I N G _ H A S H --
-- --
-- S p e c --
-- --
-- Copyright (C) 2015-2019, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package provides a generic hashing function over strings, suitable for
-- use with a string keyed hash table. In particular, it is the basis for the
-- string hash functions in Ada.Containers.
--
-- The algorithm used here is not appropriate for applications that require
-- cryptographically strong hashes, or for applications that wish to use very
-- wide hash values as pseudo unique identifiers. In such cases please refer
-- to GNAT.SHA1 and GNAT.MD5.
with System.String_Hash;
package GNAT.String_Hash renames System.String_Hash;
|
<?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>Axi_Transfer</name>
<ret_bitwidth>32</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>16</count>
<item_version>0</item_version>
<item class_id="3" tracking_level="1" version="0" object_id="_1">
<Value class_id="4" tracking_level="0" version="0">
<Obj class_id="5" tracking_level="0" version="0">
<type>1</type>
<id>1</id>
<name>in_data_data_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo class_id="6" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>in_data.data.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs class_id="7" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_2">
<Value>
<Obj>
<type>1</type>
<id>2</id>
<name>in_data_keep_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>in_data.keep.V</originalName>
<rtlName></rtlName>
<coreName></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>in_data_strb_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>in_data.strb.V</originalName>
<rtlName></rtlName>
<coreName></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="_4">
<Value>
<Obj>
<type>1</type>
<id>4</id>
<name>in_data_user_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>in_data.user.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_5">
<Value>
<Obj>
<type>1</type>
<id>5</id>
<name>in_data_last_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>in_data.last.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_6">
<Value>
<Obj>
<type>1</type>
<id>6</id>
<name>in_data_id_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>in_data.id.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_7">
<Value>
<Obj>
<type>1</type>
<id>7</id>
<name>in_data_dest_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>in_data.dest.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_8">
<Value>
<Obj>
<type>1</type>
<id>8</id>
<name>out_data_data_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>out_data.data.V</originalName>
<rtlName></rtlName>
<coreName></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="_9">
<Value>
<Obj>
<type>1</type>
<id>9</id>
<name>out_data_keep_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>out_data.keep.V</originalName>
<rtlName></rtlName>
<coreName></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="_10">
<Value>
<Obj>
<type>1</type>
<id>10</id>
<name>out_data_strb_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>out_data.strb.V</originalName>
<rtlName></rtlName>
<coreName></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="_11">
<Value>
<Obj>
<type>1</type>
<id>11</id>
<name>out_data_user_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>out_data.user.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<direction>1</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_12">
<Value>
<Obj>
<type>1</type>
<id>12</id>
<name>out_data_last_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>out_data.last.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<direction>1</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_13">
<Value>
<Obj>
<type>1</type>
<id>13</id>
<name>out_data_id_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>out_data.id.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<direction>1</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_14">
<Value>
<Obj>
<type>1</type>
<id>14</id>
<name>out_data_dest_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>out_data.dest.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<direction>1</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_15">
<Value>
<Obj>
<type>1</type>
<id>15</id>
<name>value_r</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>value</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_16">
<Value>
<Obj>
<type>1</type>
<id>16</id>
<name>loop_r</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>loop</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
</ports>
<nodes class_id="8" tracking_level="0" version="0">
<count>13</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_17">
<Value>
<Obj>
<type>0</type>
<id>17</id>
<name>loop_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>loop</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>34</item>
<item>35</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_18">
<Value>
<Obj>
<type>0</type>
<id>18</id>
<name>value_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>value</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>37</item>
<item>38</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_19">
<Value>
<Obj>
<type>0</type>
<id>21</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>44</bitwidth>
</Value>
<oprand_edges>
<count>8</count>
<item_version>0</item_version>
<item>40</item>
<item>41</item>
<item>42</item>
<item>43</item>
<item>44</item>
<item>45</item>
<item>46</item>
<item>47</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_20">
<Value>
<Obj>
<type>0</type>
<id>22</id>
<name>Temproray</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>val</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>48</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_21">
<Value>
<Obj>
<type>0</type>
<id>23</id>
<name>in_data_keep_V_tmp</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>49</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_22">
<Value>
<Obj>
<type>0</type>
<id>24</id>
<name>in_data_strb_V_tmp</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>50</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_23">
<Value>
<Obj>
<type>0</type>
<id>25</id>
<name>in_data_user_V_tmp</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>51</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_24">
<Value>
<Obj>
<type>0</type>
<id>26</id>
<name>in_data_last_V_tmp</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>52</item>
</oprand_edges>
<opcode>extractvalue</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_25">
<Value>
<Obj>
<type>0</type>
<id>27</id>
<name>in_data_id_V_tmp</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>53</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>28</id>
<name>in_data_dest_V_tmp</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>54</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>29</id>
<name>out_data_data_V_tmp</name>
<fileName>deeplib/main.cpp</fileName>
<fileDirectory>/home/common/FPGA/CONV/CNNIOT/deeplib</fileDirectory>
<lineNumber>16</lineNumber>
<contextFuncName>Axi_Transfer</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="11" tracking_level="0" version="0">
<first>/home/common/FPGA/CONV/CNNIOT/deeplib</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>deeplib/main.cpp</first>
<second>Axi_Transfer</second>
</first>
<second>16</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>val</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>55</item>
<item>56</item>
<item>57</item>
</oprand_edges>
<opcode>select</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_28">
<Value>
<Obj>
<type>0</type>
<id>30</id>
<name></name>
<fileName>deeplib/main.cpp</fileName>
<fileDirectory>/home/common/FPGA/CONV/CNNIOT/deeplib</fileDirectory>
<lineNumber>16</lineNumber>
<contextFuncName>Axi_Transfer</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/common/FPGA/CONV/CNNIOT/deeplib</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>deeplib/main.cpp</first>
<second>Axi_Transfer</second>
</first>
<second>16</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>15</count>
<item_version>0</item_version>
<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>
</oprand_edges>
<opcode>write</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_29">
<Value>
<Obj>
<type>0</type>
<id>31</id>
<name></name>
<fileName>deeplib/main.cpp</fileName>
<fileDirectory>/home/common/FPGA/CONV/CNNIOT/deeplib</fileDirectory>
<lineNumber>26</lineNumber>
<contextFuncName>Axi_Transfer</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/common/FPGA/CONV/CNNIOT/deeplib</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>deeplib/main.cpp</first>
<second>Axi_Transfer</second>
</first>
<second>26</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>74</item>
</oprand_edges>
<opcode>ret</opcode>
<m_Display>0</m_Display>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</consts>
<blocks class_id="16" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="17" tracking_level="1" version="0" object_id="_30">
<Obj>
<type>3</type>
<id>32</id>
<name>Axi_Transfer</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>13</count>
<item_version>0</item_version>
<item>17</item>
<item>18</item>
<item>21</item>
<item>22</item>
<item>23</item>
<item>24</item>
<item>25</item>
<item>26</item>
<item>27</item>
<item>28</item>
<item>29</item>
<item>30</item>
<item>31</item>
</node_objs>
</item>
</blocks>
<edges class_id="18" tracking_level="0" version="0">
<count>34</count>
<item_version>0</item_version>
<item class_id="19" tracking_level="1" version="0" object_id="_31">
<id>35</id>
<edge_type>1</edge_type>
<source_obj>16</source_obj>
<sink_obj>17</sink_obj>
</item>
<item class_id_reference="19" object_id="_32">
<id>38</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>18</sink_obj>
</item>
<item class_id_reference="19" object_id="_33">
<id>41</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="19" object_id="_34">
<id>42</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="19" object_id="_35">
<id>43</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="19" object_id="_36">
<id>44</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="19" object_id="_37">
<id>45</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="19" object_id="_38">
<id>46</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="19" object_id="_39">
<id>47</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>21</sink_obj>
</item>
<item class_id_reference="19" object_id="_40">
<id>48</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>22</sink_obj>
</item>
<item class_id_reference="19" object_id="_41">
<id>49</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>23</sink_obj>
</item>
<item class_id_reference="19" object_id="_42">
<id>50</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>24</sink_obj>
</item>
<item class_id_reference="19" object_id="_43">
<id>51</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="19" object_id="_44">
<id>52</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>26</sink_obj>
</item>
<item class_id_reference="19" object_id="_45">
<id>53</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>27</sink_obj>
</item>
<item class_id_reference="19" object_id="_46">
<id>54</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>28</sink_obj>
</item>
<item class_id_reference="19" object_id="_47">
<id>55</id>
<edge_type>1</edge_type>
<source_obj>17</source_obj>
<sink_obj>29</sink_obj>
</item>
<item class_id_reference="19" object_id="_48">
<id>56</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>29</sink_obj>
</item>
<item class_id_reference="19" object_id="_49">
<id>57</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>29</sink_obj>
</item>
<item class_id_reference="19" object_id="_50">
<id>60</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="19" object_id="_51">
<id>61</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="19" object_id="_52">
<id>62</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="19" object_id="_53">
<id>63</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="19" object_id="_54">
<id>64</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="19" object_id="_55">
<id>65</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="19" object_id="_56">
<id>66</id>
<edge_type>1</edge_type>
<source_obj>14</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="19" object_id="_57">
<id>67</id>
<edge_type>1</edge_type>
<source_obj>29</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="19" object_id="_58">
<id>68</id>
<edge_type>1</edge_type>
<source_obj>23</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="19" object_id="_59">
<id>69</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="19" object_id="_60">
<id>70</id>
<edge_type>1</edge_type>
<source_obj>25</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="19" object_id="_61">
<id>71</id>
<edge_type>1</edge_type>
<source_obj>26</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="19" object_id="_62">
<id>72</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="19" object_id="_63">
<id>73</id>
<edge_type>1</edge_type>
<source_obj>28</source_obj>
<sink_obj>30</sink_obj>
</item>
<item class_id_reference="19" object_id="_64">
<id>74</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>31</sink_obj>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="20" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="21" tracking_level="1" version="0" object_id="_65">
<mId>1</mId>
<mTag>Axi_Transfer</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>32</item>
</basic_blocks>
<mII>1</mII>
<mDepth>1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
</cdfg_regions>
<fsm class_id="23" tracking_level="1" version="0" object_id="_66">
<states class_id="24" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="25" tracking_level="1" version="0" object_id="_67">
<id>1</id>
<operations class_id="26" tracking_level="0" version="0">
<count>15</count>
<item_version>0</item_version>
<item class_id="27" tracking_level="1" version="0" object_id="_68">
<id>17</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="27" object_id="_69">
<id>18</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="27" object_id="_70">
<id>19</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="27" object_id="_71">
<id>20</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="27" object_id="_72">
<id>21</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="27" object_id="_73">
<id>22</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="27" object_id="_74">
<id>23</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="27" object_id="_75">
<id>24</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="27" object_id="_76">
<id>25</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="27" object_id="_77">
<id>26</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="27" object_id="_78">
<id>27</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="27" object_id="_79">
<id>28</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="27" object_id="_80">
<id>29</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="27" object_id="_81">
<id>30</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="27" object_id="_82">
<id>31</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
</states>
<transitions class_id="28" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</transitions>
</fsm>
<res class_id="-1"></res>
<node_label_latency class_id="30" tracking_level="0" version="0">
<count>13</count>
<item_version>0</item_version>
<item class_id="31" tracking_level="0" version="0">
<first>17</first>
<second class_id="32" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>18</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>21</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>22</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>23</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>24</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>25</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>26</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>27</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>28</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>29</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>30</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>31</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="33" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="34" tracking_level="0" version="0">
<first>32</first>
<second class_id="35" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="36" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="37" tracking_level="1" version="0" object_id="_83">
<region_name>Axi_Transfer</region_name>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</basic_blocks>
<nodes>
<count>0</count>
<item_version>0</item_version>
</nodes>
<anchor_node>-1</anchor_node>
<region_type>8</region_type>
<interval>1</interval>
<pipe_depth>1</pipe_depth>
</item>
</regions>
<dp_fu_nodes class_id="38" tracking_level="0" version="0">
<count>12</count>
<item_version>0</item_version>
<item class_id="39" tracking_level="0" version="0">
<first>50</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>17</item>
</second>
</item>
<item>
<first>56</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
<item>
<first>62</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>80</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>105</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>109</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</second>
</item>
<item>
<first>114</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>119</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>124</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
<item>
<first>129</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>134</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>28</item>
</second>
</item>
<item>
<first>139</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</item>
</second>
</item>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="41" tracking_level="0" version="0">
<count>8</count>
<item_version>0</item_version>
<item class_id="42" tracking_level="0" version="0">
<first>Temproray_fu_105</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>in_data_dest_V_tmp_fu_134</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>28</item>
</second>
</item>
<item>
<first>in_data_id_V_tmp_fu_129</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>in_data_keep_V_tmp_fu_109</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</second>
</item>
<item>
<first>in_data_last_V_tmp_fu_124</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
<item>
<first>in_data_strb_V_tmp_fu_114</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>in_data_user_V_tmp_fu_119</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>out_data_data_V_tmp_fu_139</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</item>
</second>
</item>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_module>
<dp_fu_nodes_io>
<count>4</count>
<item_version>0</item_version>
<item>
<first>StgValue_15_write_fu_80</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>empty_read_fu_62</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>loop_read_read_fu_50</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>17</item>
</second>
</item>
<item>
<first>value_read_read_fu_56</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</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="43" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>0</count>
<item_version>0</item_version>
</dp_reg_nodes>
<dp_regname_nodes>
<count>0</count>
<item_version>0</item_version>
</dp_regname_nodes>
<dp_reg_phi>
<count>0</count>
<item_version>0</item_version>
</dp_reg_phi>
<dp_regname_phi>
<count>0</count>
<item_version>0</item_version>
</dp_regname_phi>
<dp_port_io_nodes class_id="44" tracking_level="0" version="0">
<count>16</count>
<item_version>0</item_version>
<item class_id="45" tracking_level="0" version="0">
<first>in_data_data_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>21</item>
</second>
</item>
</second>
</item>
<item>
<first>in_data_dest_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>21</item>
</second>
</item>
</second>
</item>
<item>
<first>in_data_id_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>21</item>
</second>
</item>
</second>
</item>
<item>
<first>in_data_keep_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>21</item>
</second>
</item>
</second>
</item>
<item>
<first>in_data_last_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
</second>
</item>
<item>
<first>in_data_strb_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>21</item>
</second>
</item>
</second>
</item>
<item>
<first>in_data_user_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>21</item>
</second>
</item>
</second>
</item>
<item>
<first>loop_r</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>17</item>
</second>
</item>
</second>
</item>
<item>
<first>out_data_data_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>write</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
</second>
</item>
<item>
<first>out_data_dest_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>write</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
</second>
</item>
<item>
<first>out_data_id_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>write</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
</second>
</item>
<item>
<first>out_data_keep_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>write</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
</second>
</item>
<item>
<first>out_data_last_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>write</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
</second>
</item>
<item>
<first>out_data_strb_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>write</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
</second>
</item>
<item>
<first>out_data_user_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>write</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
</second>
</item>
<item>
<first>value_r</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
</second>
</item>
</dp_port_io_nodes>
<port2core class_id="46" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</port2core>
<node2core>
<count>0</count>
<item_version>0</item_version>
</node2core>
</syndb>
</boost_serialization>
|
-- Copyright 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 Linted.Errors;
with Linted.KOs;
with Linted.Update;
with Linted.Triggers;
package Linted.Update_Reader is
pragma Elaborate_Body;
type Event is record
Data : Update.Packet;
Err : Errors.Error := 0;
end record;
type Future is limited private with
Preelaborable_Initialization;
function Is_Live (F : Future) return Boolean;
procedure Read
(Object : KOs.KO;
Signaller : Triggers.Signaller;
F : out Future) with
Post => Is_Live (F);
procedure Read_Wait (F : in out Future; E : out Event) with
Pre => Is_Live (F),
Post => not Is_Live (F);
procedure Read_Poll
(F : in out Future;
E : out Event;
Init : out Boolean) with
Pre => Is_Live (F),
Post => (if Init then not Is_Live (F) else Is_Live (F));
private
Max_Nodes : constant := 2;
type Future is range 0 .. Max_Nodes + 1 with
Default_Value => 0;
end Linted.Update_Reader;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2015-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. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Asis;
with Engines.Contexts;
with League.Strings;
package Properties.Expressions.Identifiers is
function Address
(Engine : access Engines.Contexts.Context;
Element : Asis.Declaration;
Name : Engines.Text_Property) return League.Strings.Universal_String;
function Code
(Engine : access Engines.Contexts.Context;
Element : Asis.Expression;
Name : Engines.Text_Property) return League.Strings.Universal_String;
function Bounds
(Engine : access Engines.Contexts.Context;
Element : Asis.Expression;
Name : Engines.Text_Property) return League.Strings.Universal_String;
function Call_Convention
(Engine : access Engines.Contexts.Context;
Element : Asis.Declaration;
Name : Engines.Convention_Property)
return Engines.Convention_Kind;
function Initialize
(Engine : access Engines.Contexts.Context;
Element : Asis.Expression;
Name : Engines.Text_Property) return League.Strings.Universal_String;
function Intrinsic_Name
(Engine : access Engines.Contexts.Context;
Element : Asis.Declaration;
Name : Engines.Text_Property) return League.Strings.Universal_String;
function Is_Dispatching
(Engine : access Engines.Contexts.Context;
Element : Asis.Declaration;
Name : Engines.Boolean_Property) return Boolean;
function Name_Prefix
(Engine : access Engines.Contexts.Context;
Name : Asis.Identifier;
Decl : Asis.Declaration) return League.Strings.Universal_String;
function Alignment
(Engine : access Engines.Contexts.Context;
Element : Asis.Expression;
Name : Engines.Integer_Property) return Integer;
end Properties.Expressions.Identifiers;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- P A R . C H 9 --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
pragma Style_Checks (All_Checks);
-- Turn off subprogram body ordering check. Subprograms are in order by RM
-- section rather than alphabetical.
separate (Par)
package body Ch9 is
-- Local subprograms, used only in this chapter
function P_Accept_Alternative return Node_Id;
function P_Delay_Alternative return Node_Id;
function P_Delay_Relative_Statement return Node_Id;
function P_Delay_Until_Statement return Node_Id;
function P_Entry_Barrier return Node_Id;
function P_Entry_Body_Formal_Part return Node_Id;
function P_Entry_Declaration return Node_Id;
function P_Entry_Index_Specification return Node_Id;
function P_Protected_Definition return Node_Id;
function P_Protected_Operation_Declaration_Opt return Node_Id;
function P_Protected_Operation_Items return List_Id;
function P_Task_Items return List_Id;
function P_Task_Definition return Node_Id;
-----------------------------
-- 9.1 Task (also 10.1.3) --
-----------------------------
-- TASK_TYPE_DECLARATION ::=
-- task type DEFINING_IDENTIFIER [KNOWN_DISCRIMINANT_PART]
-- [ASPECT_SPECIFICATIONS]
-- [is [new INTERFACE_LIST with] TASK_DEFINITION];
-- SINGLE_TASK_DECLARATION ::=
-- task DEFINING_IDENTIFIER
-- [ASPECT_SPECIFICATIONS]
-- [is [new INTERFACE_LIST with] TASK_DEFINITION];
-- TASK_BODY ::=
-- task body DEFINING_IDENTIFIER [ASPECT_SPECIFICATIONS] is
-- DECLARATIVE_PART
-- begin
-- HANDLED_SEQUENCE_OF_STATEMENTS
-- end [task_IDENTIFIER]
-- TASK_BODY_STUB ::=
-- task body DEFINING_IDENTIFIER is separate
-- [ASPECT_SPECIFICATIONS];
-- This routine scans out a task declaration, task body, or task stub
-- The caller has checked that the initial token is TASK and scanned
-- past it, so that Token is set to the token after TASK
-- Error recovery: cannot raise Error_Resync
function P_Task return Node_Id is
Aspect_Sloc : Source_Ptr := No_Location;
Name_Node : Node_Id;
Task_Node : Node_Id;
Task_Sloc : Source_Ptr;
Dummy_Node : constant Node_Id := New_Node (N_Task_Body, Token_Ptr);
-- Placeholder node used to hold legal or prematurely declared aspect
-- specifications. Depending on the context, the aspect specifications
-- may be moved to a new node.
begin
Push_Scope_Stack;
Scopes (Scope.Last).Etyp := E_Name;
Scopes (Scope.Last).Ecol := Start_Column;
Scopes (Scope.Last).Sloc := Token_Ptr;
Scopes (Scope.Last).Lreq := False;
Task_Sloc := Prev_Token_Ptr;
if Token = Tok_Body then
Scan; -- past BODY
Name_Node := P_Defining_Identifier (C_Is);
Scopes (Scope.Last).Labl := Name_Node;
Current_Node := Name_Node;
if Token = Tok_Left_Paren then
Error_Msg_SC ("discriminant part not allowed in task body");
Discard_Junk_List (P_Known_Discriminant_Part_Opt);
end if;
if Aspect_Specifications_Present then
Aspect_Sloc := Token_Ptr;
P_Aspect_Specifications (Dummy_Node, Semicolon => False);
end if;
TF_Is;
-- Task stub
if Token = Tok_Separate then
Scan; -- past SEPARATE
Task_Node := New_Node (N_Task_Body_Stub, Task_Sloc);
Set_Defining_Identifier (Task_Node, Name_Node);
if Has_Aspects (Dummy_Node) then
Error_Msg
("aspect specifications must come after SEPARATE",
Aspect_Sloc);
end if;
P_Aspect_Specifications (Task_Node, Semicolon => False);
TF_Semicolon;
Pop_Scope_Stack; -- remove unused entry
-- Task body
else
Task_Node := New_Node (N_Task_Body, Task_Sloc);
Set_Defining_Identifier (Task_Node, Name_Node);
-- Move the aspect specifications to the body node
if Has_Aspects (Dummy_Node) then
Move_Aspects (From => Dummy_Node, To => Task_Node);
end if;
Parse_Decls_Begin_End (Task_Node);
-- The statement list of a task body needs to include at least a
-- null statement, so if a parsing error produces an empty list,
-- patch it now.
if No (First (Statements
(Handled_Statement_Sequence (Task_Node))))
then
Set_Statements (Handled_Statement_Sequence (Task_Node),
New_List (Make_Null_Statement (Token_Ptr)));
end if;
end if;
return Task_Node;
-- Otherwise we must have a task declaration
else
if Token = Tok_Type then
Scan; -- past TYPE
Task_Node := New_Node (N_Task_Type_Declaration, Task_Sloc);
Name_Node := P_Defining_Identifier;
Set_Defining_Identifier (Task_Node, Name_Node);
Scopes (Scope.Last).Labl := Name_Node;
Current_Node := Name_Node;
Set_Discriminant_Specifications
(Task_Node, P_Known_Discriminant_Part_Opt);
else
Task_Node := New_Node (N_Single_Task_Declaration, Task_Sloc);
Name_Node := P_Defining_Identifier (C_Is);
Set_Defining_Identifier (Task_Node, Name_Node);
Scopes (Scope.Last).Labl := Name_Node;
Current_Node := Name_Node;
if Token = Tok_Left_Paren then
Error_Msg_SC ("discriminant part not allowed for single task");
Discard_Junk_List (P_Known_Discriminant_Part_Opt);
end if;
end if;
-- Scan aspect specifications, don't eat the semicolon, since it
-- might not be there if we have an IS.
P_Aspect_Specifications (Task_Node, Semicolon => False);
-- Parse optional task definition. Note that P_Task_Definition scans
-- out the semicolon and possible aspect specifications as well as
-- the task definition itself.
if Token = Tok_Semicolon then
-- A little check, if the next token after semicolon is Entry,
-- then surely the semicolon should really be IS
Scan; -- past semicolon
if Token = Tok_Entry then
Error_Msg_SP -- CODEFIX
("|"";"" should be IS");
Set_Task_Definition (Task_Node, P_Task_Definition);
else
Pop_Scope_Stack; -- Remove unused entry
end if;
-- Here we have a task definition
else
TF_Is; -- must have IS if no semicolon
-- Ada 2005 (AI-345)
if Token = Tok_New then
Scan; -- past NEW
if Ada_Version < Ada_2005 then
Error_Msg_SP ("task interface is an Ada 2005 extension");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
end if;
Set_Interface_List (Task_Node, New_List);
loop
Append (P_Qualified_Simple_Name, Interface_List (Task_Node));
exit when Token /= Tok_And;
Scan; -- past AND
end loop;
if Token /= Tok_With then
Error_Msg_SC -- CODEFIX
("WITH expected");
end if;
Scan; -- past WITH
if Token = Tok_Private then
Error_Msg_SP -- CODEFIX
("PRIVATE not allowed in task type declaration");
end if;
end if;
Set_Task_Definition (Task_Node, P_Task_Definition);
end if;
return Task_Node;
end if;
end P_Task;
--------------------------------
-- 9.1 Task Type Declaration --
--------------------------------
-- Parsed by P_Task (9.1)
----------------------------------
-- 9.1 Single Task Declaration --
----------------------------------
-- Parsed by P_Task (9.1)
--------------------------
-- 9.1 Task Definition --
--------------------------
-- TASK_DEFINITION ::=
-- {TASK_ITEM}
-- [private
-- {TASK_ITEM}]
-- end [task_IDENTIFIER];
-- The caller has already made the scope stack entry
-- Note: there is a small deviation from official syntax here in that we
-- regard the semicolon after end as part of the Task_Definition, and in
-- the official syntax, it's part of the enclosing declaration. The reason
-- for this deviation is that otherwise the end processing would have to
-- be special cased, which would be a nuisance.
-- Error recovery: cannot raise Error_Resync
function P_Task_Definition return Node_Id is
Def_Node : Node_Id;
begin
Def_Node := New_Node (N_Task_Definition, Token_Ptr);
Set_Visible_Declarations (Def_Node, P_Task_Items);
if Token = Tok_Private then
Scan; -- past PRIVATE
Set_Private_Declarations (Def_Node, P_Task_Items);
-- Deal gracefully with multiple PRIVATE parts
while Token = Tok_Private loop
Error_Msg_SC ("only one private part allowed per task");
Scan; -- past PRIVATE
Append_List (P_Task_Items, Private_Declarations (Def_Node));
end loop;
end if;
End_Statements (Def_Node);
return Def_Node;
end P_Task_Definition;
--------------------
-- 9.1 Task Item --
--------------------
-- TASK_ITEM ::= ENTRY_DECLARATION | REPRESENTATION_CLAUSE
-- This subprogram scans a (possibly empty) list of task items and pragmas
-- Error recovery: cannot raise Error_Resync
-- Note: a pragma can also be returned in this position
function P_Task_Items return List_Id is
Items : List_Id;
Item_Node : Node_Id;
Decl_Sloc : Source_Ptr;
begin
-- Get rid of active SIS entry from outer scope. This means we will
-- miss some nested cases, but it doesn't seem worth the effort. See
-- discussion in Par for further details
SIS_Entry_Active := False;
-- Loop to scan out task items
Items := New_List;
Decl_Loop : loop
Decl_Sloc := Token_Ptr;
if Token = Tok_Pragma then
P_Pragmas_Opt (Items);
-- Ada 2005 (AI-397): Reserved words NOT and OVERRIDING may begin an
-- entry declaration.
elsif Token = Tok_Entry
or else Token = Tok_Not
or else Token = Tok_Overriding
then
Append (P_Entry_Declaration, Items);
elsif Token = Tok_For then
-- Representation clause in task declaration. The only rep clause
-- which is legal in a protected declaration is an address clause,
-- so that is what we try to scan out.
Item_Node := P_Representation_Clause;
if Nkind (Item_Node) = N_At_Clause then
Append (Item_Node, Items);
elsif Nkind (Item_Node) = N_Attribute_Definition_Clause
and then Chars (Item_Node) = Name_Address
then
Append (Item_Node, Items);
else
Error_Msg
("the only representation clause " &
"allowed here is an address clause!", Decl_Sloc);
end if;
elsif Token = Tok_Identifier
or else Token in Token_Class_Declk
then
Error_Msg_SC ("illegal declaration in task definition");
Resync_Past_Semicolon;
else
exit Decl_Loop;
end if;
end loop Decl_Loop;
return Items;
end P_Task_Items;
--------------------
-- 9.1 Task Body --
--------------------
-- Parsed by P_Task (9.1)
----------------------------------
-- 9.4 Protected (also 10.1.3) --
----------------------------------
-- PROTECTED_TYPE_DECLARATION ::=
-- protected type DEFINING_IDENTIFIER [KNOWN_DISCRIMINANT_PART]
-- [ASPECT_SPECIFICATIONS]
-- is [new INTERFACE_LIST with] PROTECTED_DEFINITION;
-- SINGLE_PROTECTED_DECLARATION ::=
-- protected DEFINING_IDENTIFIER
-- [ASPECT_SPECIFICATIONS]
-- is [new INTERFACE_LIST with] PROTECTED_DEFINITION;
-- PROTECTED_BODY ::=
-- protected body DEFINING_IDENTIFIER
-- [ASPECT_SPECIFICATIONS]
-- is
-- {PROTECTED_OPERATION_ITEM}
-- end [protected_IDENTIFIER];
-- PROTECTED_BODY_STUB ::=
-- protected body DEFINING_IDENTIFIER is separate
-- [ASPECT_SPECIFICATIONS];
-- This routine scans out a protected declaration, protected body
-- or a protected stub.
-- The caller has checked that the initial token is PROTECTED and
-- scanned past it, so Token is set to the following token.
-- Error recovery: cannot raise Error_Resync
function P_Protected return Node_Id is
Aspect_Sloc : Source_Ptr := No_Location;
Name_Node : Node_Id;
Protected_Node : Node_Id;
Protected_Sloc : Source_Ptr;
Scan_State : Saved_Scan_State;
Dummy_Node : constant Node_Id := New_Node (N_Protected_Body, Token_Ptr);
-- Placeholder node used to hold legal or prematurely declared aspect
-- specifications. Depending on the context, the aspect specifications
-- may be moved to a new node.
begin
Push_Scope_Stack;
Scopes (Scope.Last).Etyp := E_Name;
Scopes (Scope.Last).Ecol := Start_Column;
Scopes (Scope.Last).Lreq := False;
Protected_Sloc := Prev_Token_Ptr;
if Token = Tok_Body then
Scan; -- past BODY
Name_Node := P_Defining_Identifier (C_Is);
Scopes (Scope.Last).Labl := Name_Node;
Current_Node := Name_Node;
if Token = Tok_Left_Paren then
Error_Msg_SC ("discriminant part not allowed in protected body");
Discard_Junk_List (P_Known_Discriminant_Part_Opt);
end if;
if Aspect_Specifications_Present then
Aspect_Sloc := Token_Ptr;
P_Aspect_Specifications (Dummy_Node, Semicolon => False);
end if;
TF_Is;
-- Protected stub
if Token = Tok_Separate then
Scan; -- past SEPARATE
Protected_Node := New_Node (N_Protected_Body_Stub, Protected_Sloc);
Set_Defining_Identifier (Protected_Node, Name_Node);
if Has_Aspects (Dummy_Node) then
Error_Msg
("aspect specifications must come after SEPARATE",
Aspect_Sloc);
end if;
P_Aspect_Specifications (Protected_Node, Semicolon => False);
TF_Semicolon;
Pop_Scope_Stack; -- remove unused entry
-- Protected body
else
Protected_Node := New_Node (N_Protected_Body, Protected_Sloc);
Set_Defining_Identifier (Protected_Node, Name_Node);
Move_Aspects (From => Dummy_Node, To => Protected_Node);
Set_Declarations (Protected_Node, P_Protected_Operation_Items);
End_Statements (Protected_Node);
end if;
return Protected_Node;
-- Otherwise we must have a protected declaration
else
if Token = Tok_Type then
Scan; -- past TYPE
Protected_Node :=
New_Node (N_Protected_Type_Declaration, Protected_Sloc);
Name_Node := P_Defining_Identifier (C_Is);
Set_Defining_Identifier (Protected_Node, Name_Node);
Scopes (Scope.Last).Labl := Name_Node;
Current_Node := Name_Node;
Set_Discriminant_Specifications
(Protected_Node, P_Known_Discriminant_Part_Opt);
else
Protected_Node :=
New_Node (N_Single_Protected_Declaration, Protected_Sloc);
Name_Node := P_Defining_Identifier (C_Is);
Set_Defining_Identifier (Protected_Node, Name_Node);
if Token = Tok_Left_Paren then
Error_Msg_SC
("discriminant part not allowed for single protected");
Discard_Junk_List (P_Known_Discriminant_Part_Opt);
end if;
Scopes (Scope.Last).Labl := Name_Node;
Current_Node := Name_Node;
end if;
P_Aspect_Specifications (Protected_Node, Semicolon => False);
-- Check for semicolon not followed by IS, this is something like
-- protected type r;
-- where we want
-- protected type r IS END;
if Token = Tok_Semicolon then
Save_Scan_State (Scan_State); -- at semicolon
Scan; -- past semicolon
if Token /= Tok_Is then
Restore_Scan_State (Scan_State);
Error_Msg_SC -- CODEFIX
("missing IS");
Set_Protected_Definition (Protected_Node,
Make_Protected_Definition (Token_Ptr,
Visible_Declarations => Empty_List,
End_Label => Empty));
SIS_Entry_Active := False;
End_Statements
(Protected_Definition (Protected_Node), Protected_Node);
return Protected_Node;
end if;
Error_Msg_SP -- CODEFIX
("|extra ""("" ignored");
end if;
T_Is;
-- Ada 2005 (AI-345)
if Token = Tok_New then
Scan; -- past NEW
if Ada_Version < Ada_2005 then
Error_Msg_SP ("protected interface is an Ada 2005 extension");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
end if;
Set_Interface_List (Protected_Node, New_List);
loop
Append (P_Qualified_Simple_Name,
Interface_List (Protected_Node));
exit when Token /= Tok_And;
Scan; -- past AND
end loop;
if Token /= Tok_With then
Error_Msg_SC -- CODEFIX
("WITH expected");
end if;
Scan; -- past WITH
end if;
Set_Protected_Definition (Protected_Node, P_Protected_Definition);
return Protected_Node;
end if;
end P_Protected;
-------------------------------------
-- 9.4 Protected Type Declaration --
-------------------------------------
-- Parsed by P_Protected (9.4)
---------------------------------------
-- 9.4 Single Protected Declaration --
---------------------------------------
-- Parsed by P_Protected (9.4)
-------------------------------
-- 9.4 Protected Definition --
-------------------------------
-- PROTECTED_DEFINITION ::=
-- {PROTECTED_OPERATION_DECLARATION}
-- [private
-- {PROTECTED_ELEMENT_DECLARATION}]
-- end [protected_IDENTIFIER]
-- PROTECTED_ELEMENT_DECLARATION ::=
-- PROTECTED_OPERATION_DECLARATION
-- | COMPONENT_DECLARATION
-- The caller has already established the scope stack entry
-- Error recovery: cannot raise Error_Resync
function P_Protected_Definition return Node_Id is
Def_Node : Node_Id;
Item_Node : Node_Id;
Priv_Decls : List_Id;
Vis_Decls : List_Id;
begin
Def_Node := New_Node (N_Protected_Definition, Token_Ptr);
-- Get rid of active SIS entry from outer scope. This means we will
-- miss some nested cases, but it doesn't seem worth the effort. See
-- discussion in Par for further details
SIS_Entry_Active := False;
-- Loop to scan visible declarations (protected operation declarations)
Vis_Decls := New_List;
Set_Visible_Declarations (Def_Node, Vis_Decls);
-- Flag and discard all pragmas which cannot appear in the protected
-- definition. Note that certain pragmas are still allowed as long as
-- they apply to entries, entry families, or protected subprograms.
P_Pragmas_Opt (Vis_Decls);
loop
Item_Node := P_Protected_Operation_Declaration_Opt;
if Present (Item_Node) then
Append (Item_Node, Vis_Decls);
end if;
P_Pragmas_Opt (Vis_Decls);
exit when No (Item_Node);
end loop;
-- Deal with PRIVATE part (including graceful handling of multiple
-- PRIVATE parts).
Private_Loop : while Token = Tok_Private loop
Priv_Decls := Private_Declarations (Def_Node);
if Present (Priv_Decls) then
Error_Msg_SC ("duplicate private part");
else
Priv_Decls := New_List;
Set_Private_Declarations (Def_Node, Priv_Decls);
end if;
Scan; -- past PRIVATE
-- Flag and discard all pragmas which cannot appear in the protected
-- definition. Note that certain pragmas are still allowed as long as
-- they apply to entries, entry families, or protected subprograms.
P_Pragmas_Opt (Priv_Decls);
Declaration_Loop : loop
if Token = Tok_Identifier then
P_Component_Items (Priv_Decls);
P_Pragmas_Opt (Priv_Decls);
else
Item_Node := P_Protected_Operation_Declaration_Opt;
if Present (Item_Node) then
Append (Item_Node, Priv_Decls);
end if;
P_Pragmas_Opt (Priv_Decls);
exit Declaration_Loop when No (Item_Node);
end if;
end loop Declaration_Loop;
end loop Private_Loop;
End_Statements (Def_Node);
return Def_Node;
end P_Protected_Definition;
------------------------------------------
-- 9.4 Protected Operation Declaration --
------------------------------------------
-- PROTECTED_OPERATION_DECLARATION ::=
-- SUBPROGRAM_DECLARATION
-- | ENTRY_DECLARATION
-- | REPRESENTATION_CLAUSE
-- Error recovery: cannot raise Error_Resync
-- Note: a pragma can also be returned in this position
-- We are not currently permitting representation clauses to appear as
-- protected operation declarations, do we have to rethink this???
function P_Protected_Operation_Declaration_Opt return Node_Id is
L : List_Id;
P : Source_Ptr;
function P_Entry_Or_Subprogram_With_Indicator return Node_Id;
-- Ada 2005 (AI-397): Parse an entry or a subprogram with an overriding
-- indicator. The caller has checked that the initial token is NOT or
-- OVERRIDING.
------------------------------------------
-- P_Entry_Or_Subprogram_With_Indicator --
------------------------------------------
function P_Entry_Or_Subprogram_With_Indicator return Node_Id is
Decl : Node_Id := Error;
Is_Overriding : Boolean := False;
Not_Overriding : Boolean := False;
begin
if Token = Tok_Not then
Scan; -- past NOT
if Token = Tok_Overriding then
Scan; -- past OVERRIDING
Not_Overriding := True;
else
Error_Msg_SC -- CODEFIX
("OVERRIDING expected!");
end if;
else
Scan; -- past OVERRIDING
Is_Overriding := True;
end if;
if Is_Overriding or else Not_Overriding then
if Ada_Version < Ada_2005 then
Error_Msg_SP ("overriding indicator is an Ada 2005 extension");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
elsif Token = Tok_Entry then
Decl := P_Entry_Declaration;
Set_Must_Override (Decl, Is_Overriding);
Set_Must_Not_Override (Decl, Not_Overriding);
elsif Token = Tok_Function or else Token = Tok_Procedure then
Decl := P_Subprogram (Pf_Decl_Pexp);
Set_Must_Override (Specification (Decl), Is_Overriding);
Set_Must_Not_Override (Specification (Decl), Not_Overriding);
else
Error_Msg_SC -- CODEFIX
("ENTRY, FUNCTION or PROCEDURE expected!");
end if;
end if;
return Decl;
end P_Entry_Or_Subprogram_With_Indicator;
Result : Node_Id := Empty;
-- Start of processing for P_Protected_Operation_Declaration_Opt
begin
-- This loop runs more than once only when a junk declaration is skipped
loop
case Token is
when Tok_Pragma =>
Result := P_Pragma;
exit;
when Tok_Not
| Tok_Overriding
=>
Result := P_Entry_Or_Subprogram_With_Indicator;
exit;
when Tok_Entry =>
Result := P_Entry_Declaration;
exit;
when Tok_Function
| Tok_Procedure
=>
Result := P_Subprogram (Pf_Decl_Pexp);
exit;
when Tok_Identifier =>
L := New_List;
P := Token_Ptr;
Skip_Declaration (L);
if Nkind (First (L)) = N_Object_Declaration then
Error_Msg
("component must be declared in private part of " &
"protected type", P);
else
Error_Msg
("illegal declaration in protected definition", P);
end if;
-- Continue looping
when Tok_For =>
Error_Msg_SC
("representation clause not allowed in protected definition");
Resync_Past_Semicolon;
-- Continue looping
when others =>
if Token in Token_Class_Declk then
Error_Msg_SC ("illegal declaration in protected definition");
Resync_Past_Semicolon;
-- Return now to avoid cascaded messages if next declaration
-- is a valid component declaration.
Result := Error;
end if;
exit;
end case;
end loop;
if Nkind (Result) = N_Subprogram_Declaration
and then Nkind (Specification (Result)) =
N_Procedure_Specification
and then Null_Present (Specification (Result))
then
Error_Msg_N
("protected operation cannot be a null procedure",
Null_Statement (Specification (Result)));
end if;
return Result;
end P_Protected_Operation_Declaration_Opt;
-----------------------------------
-- 9.4 Protected Operation Item --
-----------------------------------
-- PROTECTED_OPERATION_ITEM ::=
-- SUBPROGRAM_DECLARATION
-- | SUBPROGRAM_BODY
-- | ENTRY_BODY
-- | REPRESENTATION_CLAUSE
-- This procedure parses and returns a list of protected operation items
-- We are not currently permitting representation clauses to appear
-- as protected operation items, do we have to rethink this???
function P_Protected_Operation_Items return List_Id is
Item_List : List_Id;
begin
Item_List := New_List;
loop
if Token = Tok_Entry or else Bad_Spelling_Of (Tok_Entry) then
Append (P_Entry_Body, Item_List);
-- If the operation starts with procedure, function, or an overriding
-- indicator ("overriding" or "not overriding"), parse a subprogram.
elsif Token = Tok_Function or else Bad_Spelling_Of (Tok_Function)
or else
Token = Tok_Procedure or else Bad_Spelling_Of (Tok_Procedure)
or else
Token = Tok_Overriding or else Bad_Spelling_Of (Tok_Overriding)
or else
Token = Tok_Not or else Bad_Spelling_Of (Tok_Not)
then
Append (P_Subprogram (Pf_Decl_Pbod_Pexp), Item_List);
elsif Token = Tok_Pragma or else Bad_Spelling_Of (Tok_Pragma) then
P_Pragmas_Opt (Item_List);
elsif Token = Tok_Private or else Bad_Spelling_Of (Tok_Private) then
Error_Msg_SC ("PRIVATE not allowed in protected body");
Scan; -- past PRIVATE
elsif Token = Tok_Identifier then
Error_Msg_SC ("all components must be declared in spec!");
Resync_Past_Semicolon;
elsif Token in Token_Class_Declk then
Error_Msg_SC ("this declaration not allowed in protected body");
Resync_Past_Semicolon;
else
exit;
end if;
end loop;
return Item_List;
end P_Protected_Operation_Items;
------------------------------
-- 9.5.2 Entry Declaration --
------------------------------
-- ENTRY_DECLARATION ::=
-- [OVERRIDING_INDICATOR]
-- entry DEFINING_IDENTIFIER
-- [(DISCRETE_SUBTYPE_DEFINITION)] PARAMETER_PROFILE
-- [ASPECT_SPECIFICATIONS];
-- The caller has checked that the initial token is ENTRY, NOT or
-- OVERRIDING.
-- Error recovery: cannot raise Error_Resync
function P_Entry_Declaration return Node_Id is
Decl_Node : Node_Id;
Scan_State : Saved_Scan_State;
-- Flags for optional overriding indication. Two flags are needed,
-- to distinguish positive and negative overriding indicators from
-- the absence of any indicator.
Is_Overriding : Boolean := False;
Not_Overriding : Boolean := False;
begin
-- Ada 2005 (AI-397): Scan leading overriding indicator
if Token = Tok_Not then
Scan; -- past NOT
if Token = Tok_Overriding then
Scan; -- part OVERRIDING
Not_Overriding := True;
else
Error_Msg_SC -- CODEFIX
("OVERRIDING expected!");
end if;
elsif Token = Tok_Overriding then
Scan; -- part OVERRIDING
Is_Overriding := True;
end if;
if Is_Overriding or else Not_Overriding then
if Ada_Version < Ada_2005 then
Error_Msg_SP ("overriding indicator is an Ada 2005 extension");
Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
elsif Token /= Tok_Entry then
Error_Msg_SC -- CODEFIX
("ENTRY expected!");
end if;
end if;
Decl_Node := New_Node (N_Entry_Declaration, Token_Ptr);
Scan; -- past ENTRY
Set_Defining_Identifier
(Decl_Node, P_Defining_Identifier (C_Left_Paren_Semicolon));
-- If left paren, could be (Discrete_Subtype_Definition) or Formal_Part
if Token = Tok_Left_Paren then
Scan; -- past (
-- If identifier after left paren, could still be either
if Token = Tok_Identifier then
Save_Scan_State (Scan_State); -- at Id
Scan; -- past Id
-- If comma or colon after Id, must be Formal_Part
if Token = Tok_Comma or else Token = Tok_Colon then
Restore_Scan_State (Scan_State); -- to Id
Set_Parameter_Specifications (Decl_Node, P_Formal_Part);
-- Else if Id without comma or colon, must be discrete subtype
-- defn
else
Restore_Scan_State (Scan_State); -- to Id
Set_Discrete_Subtype_Definition
(Decl_Node, P_Discrete_Subtype_Definition);
T_Right_Paren;
Set_Parameter_Specifications (Decl_Node, P_Parameter_Profile);
end if;
-- If no Id, must be discrete subtype definition
else
Set_Discrete_Subtype_Definition
(Decl_Node, P_Discrete_Subtype_Definition);
T_Right_Paren;
Set_Parameter_Specifications (Decl_Node, P_Parameter_Profile);
end if;
end if;
if Is_Overriding then
Set_Must_Override (Decl_Node);
elsif Not_Overriding then
Set_Must_Not_Override (Decl_Node);
end if;
-- Error recovery check for illegal return
if Token = Tok_Return then
Error_Msg_SC ("entry cannot have return value!");
Scan;
Discard_Junk_Node (P_Subtype_Indication);
end if;
-- Error recovery check for improper use of entry barrier in spec
if Token = Tok_When then
Error_Msg_SC ("barrier not allowed here (belongs in body)");
Scan; -- past WHEN;
Discard_Junk_Node (P_Expression_No_Right_Paren);
end if;
P_Aspect_Specifications (Decl_Node);
return Decl_Node;
exception
when Error_Resync =>
Resync_Past_Semicolon;
return Error;
end P_Entry_Declaration;
-----------------------------
-- 9.5.2 Accept Statement --
-----------------------------
-- ACCEPT_STATEMENT ::=
-- accept entry_DIRECT_NAME
-- [(ENTRY_INDEX)] PARAMETER_PROFILE [do
-- HANDLED_SEQUENCE_OF_STATEMENTS
-- end [entry_IDENTIFIER]];
-- The caller has checked that the initial token is ACCEPT
-- Error recovery: cannot raise Error_Resync. If an error occurs, the
-- scan is resynchronized past the next semicolon and control returns.
function P_Accept_Statement return Node_Id is
Scan_State : Saved_Scan_State;
Accept_Node : Node_Id;
Hand_Seq : Node_Id;
begin
Push_Scope_Stack;
Scopes (Scope.Last).Sloc := Token_Ptr;
Scopes (Scope.Last).Ecol := Start_Column;
Accept_Node := New_Node (N_Accept_Statement, Token_Ptr);
Scan; -- past ACCEPT
Scopes (Scope.Last).Labl := Token_Node;
Current_Node := Token_Node;
Set_Entry_Direct_Name (Accept_Node, P_Identifier (C_Do));
-- Left paren could be (Entry_Index) or Formal_Part, determine which
if Token = Tok_Left_Paren then
Save_Scan_State (Scan_State); -- at left paren
Scan; -- past left paren
-- If first token after left paren not identifier, then Entry_Index
if Token /= Tok_Identifier then
Set_Entry_Index (Accept_Node, P_Expression);
T_Right_Paren;
Set_Parameter_Specifications (Accept_Node, P_Parameter_Profile);
-- First token after left paren is identifier, could be either case
else -- Token = Tok_Identifier
Scan; -- past identifier
-- If identifier followed by comma or colon, must be Formal_Part
if Token = Tok_Comma or else Token = Tok_Colon then
Restore_Scan_State (Scan_State); -- to left paren
Set_Parameter_Specifications (Accept_Node, P_Parameter_Profile);
-- If identifier not followed by comma/colon, must be entry index
else
Restore_Scan_State (Scan_State); -- to left paren
Scan; -- past left paren (again)
Set_Entry_Index (Accept_Node, P_Expression);
T_Right_Paren;
Set_Parameter_Specifications (Accept_Node, P_Parameter_Profile);
end if;
end if;
end if;
-- Scan out DO if present
if Token = Tok_Do then
Scopes (Scope.Last).Etyp := E_Name;
Scopes (Scope.Last).Lreq := False;
Scan; -- past DO
Hand_Seq := P_Handled_Sequence_Of_Statements;
Set_Handled_Statement_Sequence (Accept_Node, Hand_Seq);
End_Statements (Handled_Statement_Sequence (Accept_Node));
-- Exception handlers not allowed in Ada 95 node
if Present (Exception_Handlers (Hand_Seq)) then
if Ada_Version = Ada_83 then
Error_Msg_N
("(Ada 83) exception handlers in accept not allowed",
First_Non_Pragma (Exception_Handlers (Hand_Seq)));
end if;
end if;
else
Pop_Scope_Stack; -- discard unused entry
TF_Semicolon;
end if;
return Accept_Node;
-- If error, resynchronize past semicolon
exception
when Error_Resync =>
Resync_Past_Semicolon;
Pop_Scope_Stack; -- discard unused entry
return Error;
end P_Accept_Statement;
------------------------
-- 9.5.2 Entry Index --
------------------------
-- Parsed by P_Expression (4.4)
--------------------------
-- 9.5.2 Entry Barrier --
--------------------------
-- ENTRY_BARRIER ::= when CONDITION
-- Error_Recovery: cannot raise Error_Resync
function P_Entry_Barrier return Node_Id is
Bnode : Node_Id;
begin
if Token = Tok_When then
Scan; -- past WHEN;
Bnode := P_Expression_No_Right_Paren;
if Token = Tok_Colon_Equal then
Error_Msg_SC -- CODEFIX
("|"":="" should be ""=""");
Scan;
Bnode := P_Expression_No_Right_Paren;
end if;
else
T_When; -- to give error message
Bnode := Error;
end if;
return Bnode;
end P_Entry_Barrier;
-----------------------
-- 9.5.2 Entry Body --
-----------------------
-- ENTRY_BODY ::=
-- entry DEFINING_IDENTIFIER ENTRY_BODY_FORMAL_PART
-- [ASPECT_SPECIFICATIONS] ENTRY_BARRIER
-- is
-- DECLARATIVE_PART
-- begin
-- HANDLED_SEQUENCE_OF_STATEMENTS
-- end [entry_IDENTIFIER];
-- The caller has checked that the initial token is ENTRY
-- Error_Recovery: cannot raise Error_Resync
function P_Entry_Body return Node_Id is
Dummy_Node : Node_Id;
Entry_Node : Node_Id;
Formal_Part_Node : Node_Id;
Name_Node : Node_Id;
begin
Push_Scope_Stack;
Entry_Node := New_Node (N_Entry_Body, Token_Ptr);
Scan; -- past ENTRY
Scopes (Scope.Last).Ecol := Start_Column;
Scopes (Scope.Last).Lreq := False;
Scopes (Scope.Last).Etyp := E_Name;
Scopes (Scope.Last).Sloc := Token_Ptr;
Name_Node := P_Defining_Identifier;
Set_Defining_Identifier (Entry_Node, Name_Node);
Scopes (Scope.Last).Labl := Name_Node;
Current_Node := Name_Node;
Formal_Part_Node := P_Entry_Body_Formal_Part;
Set_Entry_Body_Formal_Part (Entry_Node, Formal_Part_Node);
-- Ada 2012 (AI12-0169): Aspect specifications may appear on an entry
-- body immediately after the formal part. Do not parse the aspect
-- specifications directly because the "when" of the entry barrier may
-- be interpreted as a misused "with".
if Token = Tok_With then
P_Aspect_Specifications (Entry_Node, Semicolon => False);
end if;
Set_Condition (Formal_Part_Node, P_Entry_Barrier);
-- Detect an illegal placement of aspect specifications following the
-- entry barrier.
-- entry E ... when Barrier with Aspect is
if Token = Tok_With then
Error_Msg_SC ("aspect specifications must come before entry barrier");
-- Consume the illegal aspects to allow for parsing to continue
Dummy_Node := New_Node (N_Entry_Body, Sloc (Entry_Node));
P_Aspect_Specifications (Dummy_Node, Semicolon => False);
end if;
TF_Is;
Parse_Decls_Begin_End (Entry_Node);
return Entry_Node;
end P_Entry_Body;
-----------------------------------
-- 9.5.2 Entry Body Formal Part --
-----------------------------------
-- ENTRY_BODY_FORMAL_PART ::=
-- [(ENTRY_INDEX_SPECIFICATION)] [PARAMETER_PART]
-- Error_Recovery: cannot raise Error_Resync
function P_Entry_Body_Formal_Part return Node_Id is
Fpart_Node : Node_Id;
Scan_State : Saved_Scan_State;
begin
Fpart_Node := New_Node (N_Entry_Body_Formal_Part, Token_Ptr);
-- See if entry index specification present, and if so parse it
if Token = Tok_Left_Paren then
Save_Scan_State (Scan_State); -- at left paren
Scan; -- past left paren
if Token = Tok_For then
Set_Entry_Index_Specification
(Fpart_Node, P_Entry_Index_Specification);
T_Right_Paren;
else
Restore_Scan_State (Scan_State); -- to left paren
end if;
-- Check for (common?) case of left paren omitted before FOR. This
-- is a tricky case, because the corresponding missing left paren
-- can cause real havoc if a formal part is present which gets
-- treated as part of the discrete subtype definition of the
-- entry index specification, so just give error and resynchronize
elsif Token = Tok_For then
T_Left_Paren; -- to give error message
Resync_To_When;
end if;
Set_Parameter_Specifications (Fpart_Node, P_Parameter_Profile);
return Fpart_Node;
end P_Entry_Body_Formal_Part;
--------------------------------------
-- 9.5.2 Entry Index Specification --
--------------------------------------
-- ENTRY_INDEX_SPECIFICATION ::=
-- for DEFINING_IDENTIFIER in DISCRETE_SUBTYPE_DEFINITION
-- Error recovery: can raise Error_Resync
function P_Entry_Index_Specification return Node_Id is
Iterator_Node : Node_Id;
begin
Iterator_Node := New_Node (N_Entry_Index_Specification, Token_Ptr);
T_For; -- past FOR
Set_Defining_Identifier (Iterator_Node, P_Defining_Identifier (C_In));
T_In;
Set_Discrete_Subtype_Definition
(Iterator_Node, P_Discrete_Subtype_Definition);
return Iterator_Node;
end P_Entry_Index_Specification;
---------------------------------
-- 9.5.3 Entry Call Statement --
---------------------------------
-- Parsed by P_Name (4.1). Within a select, an entry call is parsed
-- by P_Select_Statement (9.7)
------------------------------
-- 9.5.4 Requeue Statement --
------------------------------
-- REQUEUE_STATEMENT ::= requeue entry_NAME [with abort];
-- The caller has checked that the initial token is requeue
-- Error recovery: can raise Error_Resync
function P_Requeue_Statement return Node_Id is
Requeue_Node : Node_Id;
begin
Requeue_Node := New_Node (N_Requeue_Statement, Token_Ptr);
Scan; -- past REQUEUE
Set_Name (Requeue_Node, P_Name);
if Token = Tok_With then
Scan; -- past WITH
T_Abort;
Set_Abort_Present (Requeue_Node, True);
end if;
TF_Semicolon;
return Requeue_Node;
end P_Requeue_Statement;
--------------------------
-- 9.6 Delay Statement --
--------------------------
-- DELAY_STATEMENT ::=
-- DELAY_UNTIL_STATEMENT
-- | DELAY_RELATIVE_STATEMENT
-- The caller has checked that the initial token is DELAY
-- Error recovery: cannot raise Error_Resync
function P_Delay_Statement return Node_Id is
begin
Scan; -- past DELAY
-- The following check for delay until misused in Ada 83 doesn't catch
-- all cases, but it's good enough to catch most of them.
if Token_Name = Name_Until then
Check_95_Keyword (Tok_Until, Tok_Left_Paren);
Check_95_Keyword (Tok_Until, Tok_Identifier);
end if;
if Token = Tok_Until then
return P_Delay_Until_Statement;
else
return P_Delay_Relative_Statement;
end if;
end P_Delay_Statement;
--------------------------------
-- 9.6 Delay Until Statement --
--------------------------------
-- DELAY_UNTIL_STATEMENT ::= delay until delay_EXPRESSION;
-- The caller has checked that the initial token is DELAY, scanned it
-- out and checked that the current token is UNTIL
-- Error recovery: cannot raise Error_Resync
function P_Delay_Until_Statement return Node_Id is
Delay_Node : Node_Id;
begin
Delay_Node := New_Node (N_Delay_Until_Statement, Prev_Token_Ptr);
Scan; -- past UNTIL
Set_Expression (Delay_Node, P_Expression_No_Right_Paren);
TF_Semicolon;
return Delay_Node;
end P_Delay_Until_Statement;
-----------------------------------
-- 9.6 Delay Relative Statement --
-----------------------------------
-- DELAY_RELATIVE_STATEMENT ::= delay delay_EXPRESSION;
-- The caller has checked that the initial token is DELAY, scanned it
-- out and determined that the current token is not UNTIL
-- Error recovery: cannot raise Error_Resync
function P_Delay_Relative_Statement return Node_Id is
Delay_Node : Node_Id;
begin
Delay_Node := New_Node (N_Delay_Relative_Statement, Prev_Token_Ptr);
Set_Expression (Delay_Node, P_Expression_No_Right_Paren);
Check_Simple_Expression_In_Ada_83 (Expression (Delay_Node));
TF_Semicolon;
return Delay_Node;
end P_Delay_Relative_Statement;
---------------------------
-- 9.7 Select Statement --
---------------------------
-- SELECT_STATEMENT ::=
-- SELECTIVE_ACCEPT
-- | TIMED_ENTRY_CALL
-- | CONDITIONAL_ENTRY_CALL
-- | ASYNCHRONOUS_SELECT
-- SELECTIVE_ACCEPT ::=
-- select
-- [GUARD]
-- SELECT_ALTERNATIVE
-- {or
-- [GUARD]
-- SELECT_ALTERNATIVE
-- [else
-- SEQUENCE_OF_STATEMENTS]
-- end select;
-- GUARD ::= when CONDITION =>
-- Note: the guard preceding a select alternative is included as part
-- of the node generated for a selective accept alternative.
-- SELECT_ALTERNATIVE ::=
-- ACCEPT_ALTERNATIVE
-- | DELAY_ALTERNATIVE
-- | TERMINATE_ALTERNATIVE
-- TIMED_ENTRY_CALL ::=
-- select
-- ENTRY_CALL_ALTERNATIVE
-- or
-- DELAY_ALTERNATIVE
-- end select;
-- CONDITIONAL_ENTRY_CALL ::=
-- select
-- ENTRY_CALL_ALTERNATIVE
-- else
-- SEQUENCE_OF_STATEMENTS
-- end select;
-- ENTRY_CALL_ALTERNATIVE ::=
-- ENTRY_CALL_STATEMENT [SEQUENCE_OF_STATEMENTS]
-- ASYNCHRONOUS_SELECT ::=
-- select
-- TRIGGERING_ALTERNATIVE
-- then abort
-- ABORTABLE_PART
-- end select;
-- TRIGGERING_ALTERNATIVE ::=
-- TRIGGERING_STATEMENT [SEQUENCE_OF_STATEMENTS]
-- TRIGGERING_STATEMENT ::= ENTRY_CALL_STATEMENT | DELAY_STATEMENT
-- The caller has checked that the initial token is SELECT
-- Error recovery: can raise Error_Resync
function P_Select_Statement return Node_Id is
Select_Node : Node_Id;
Select_Sloc : Source_Ptr;
Stmnt_Sloc : Source_Ptr;
Ecall_Node : Node_Id;
Alternative : Node_Id;
Select_Pragmas : List_Id;
Alt_Pragmas : List_Id;
Statement_List : List_Id;
Alt_List : List_Id;
Cond_Expr : Node_Id;
Delay_Stmnt : Node_Id;
begin
Push_Scope_Stack;
Scopes (Scope.Last).Etyp := E_Select;
Scopes (Scope.Last).Ecol := Start_Column;
Scopes (Scope.Last).Sloc := Token_Ptr;
Scopes (Scope.Last).Labl := Error;
Select_Sloc := Token_Ptr;
Scan; -- past SELECT
Stmnt_Sloc := Token_Ptr;
Select_Pragmas := P_Pragmas_Opt;
-- If first token after select is designator, then we have an entry
-- call, which must be the start of a conditional entry call, timed
-- entry call or asynchronous select
if Token in Token_Class_Desig then
-- Scan entry call statement
begin
Ecall_Node := P_Name;
-- ?? The following two clauses exactly parallel code in ch5
-- and should be combined sometime
if Nkind (Ecall_Node) = N_Indexed_Component then
declare
Prefix_Node : constant Node_Id := Prefix (Ecall_Node);
Exprs_Node : constant List_Id := Expressions (Ecall_Node);
begin
Change_Node (Ecall_Node, N_Procedure_Call_Statement);
Set_Name (Ecall_Node, Prefix_Node);
Set_Parameter_Associations (Ecall_Node, Exprs_Node);
end;
elsif Nkind (Ecall_Node) = N_Function_Call then
declare
Fname_Node : constant Node_Id := Name (Ecall_Node);
Params_List : constant List_Id :=
Parameter_Associations (Ecall_Node);
begin
Change_Node (Ecall_Node, N_Procedure_Call_Statement);
Set_Name (Ecall_Node, Fname_Node);
Set_Parameter_Associations (Ecall_Node, Params_List);
end;
elsif Nkind (Ecall_Node) = N_Identifier
or else Nkind (Ecall_Node) = N_Selected_Component
then
-- Case of a call to a parameterless entry
declare
C_Node : constant Node_Id :=
New_Node (N_Procedure_Call_Statement, Stmnt_Sloc);
begin
Set_Name (C_Node, Ecall_Node);
Set_Parameter_Associations (C_Node, No_List);
Ecall_Node := C_Node;
end;
end if;
TF_Semicolon;
exception
when Error_Resync =>
Resync_Past_Semicolon;
return Error;
end;
Statement_List := P_Sequence_Of_Statements (SS_Eltm_Ortm_Tatm);
-- OR follows, we have a timed entry call
if Token = Tok_Or then
Scan; -- past OR
Alt_Pragmas := P_Pragmas_Opt;
Select_Node := New_Node (N_Timed_Entry_Call, Select_Sloc);
Set_Entry_Call_Alternative (Select_Node,
Make_Entry_Call_Alternative (Stmnt_Sloc,
Entry_Call_Statement => Ecall_Node,
Pragmas_Before => Select_Pragmas,
Statements => Statement_List));
-- Only possibility is delay alternative. If we have anything
-- else, give message, and treat as conditional entry call.
if Token /= Tok_Delay then
Error_Msg_SC
("only allowed alternative in timed entry call is delay!");
Discard_Junk_List (P_Sequence_Of_Statements (SS_Sreq));
Set_Delay_Alternative (Select_Node, Error);
else
Set_Delay_Alternative (Select_Node, P_Delay_Alternative);
Set_Pragmas_Before
(Delay_Alternative (Select_Node), Alt_Pragmas);
end if;
-- ELSE follows, we have a conditional entry call
elsif Token = Tok_Else then
Scan; -- past ELSE
Select_Node := New_Node (N_Conditional_Entry_Call, Select_Sloc);
Set_Entry_Call_Alternative (Select_Node,
Make_Entry_Call_Alternative (Stmnt_Sloc,
Entry_Call_Statement => Ecall_Node,
Pragmas_Before => Select_Pragmas,
Statements => Statement_List));
Set_Else_Statements
(Select_Node, P_Sequence_Of_Statements (SS_Sreq));
-- Only remaining case is THEN ABORT (asynchronous select)
elsif Token = Tok_Abort then
Select_Node :=
Make_Asynchronous_Select (Select_Sloc,
Triggering_Alternative =>
Make_Triggering_Alternative (Stmnt_Sloc,
Triggering_Statement => Ecall_Node,
Pragmas_Before => Select_Pragmas,
Statements => Statement_List),
Abortable_Part => P_Abortable_Part);
-- Else error
else
if Ada_Version = Ada_83 then
Error_Msg_BC ("OR or ELSE expected");
else
Error_Msg_BC ("OR or ELSE or THEN ABORT expected");
end if;
Select_Node := Error;
end if;
End_Statements;
-- Here we have a selective accept or an asynchronous select (first
-- token after SELECT is other than a designator token).
else
-- If we have delay with no guard, could be asynchronous select
if Token = Tok_Delay then
Delay_Stmnt := P_Delay_Statement;
Statement_List := P_Sequence_Of_Statements (SS_Eltm_Ortm_Tatm);
-- Asynchronous select
if Token = Tok_Abort then
Select_Node :=
Make_Asynchronous_Select (Select_Sloc,
Triggering_Alternative =>
Make_Triggering_Alternative (Stmnt_Sloc,
Triggering_Statement => Delay_Stmnt,
Pragmas_Before => Select_Pragmas,
Statements => Statement_List),
Abortable_Part => P_Abortable_Part);
End_Statements;
return Select_Node;
-- Delay which was not an asynchronous select. Must be a selective
-- accept, and since at least one accept statement is required,
-- we must have at least one OR phrase present.
else
Alt_List := New_List (
Make_Delay_Alternative (Stmnt_Sloc,
Delay_Statement => Delay_Stmnt,
Pragmas_Before => Select_Pragmas,
Statements => Statement_List));
T_Or;
Alt_Pragmas := P_Pragmas_Opt;
end if;
-- If not a delay statement, then must be another possibility for
-- a selective accept alternative, or perhaps a guard is present
else
Alt_List := New_List;
Alt_Pragmas := Select_Pragmas;
end if;
Select_Node := New_Node (N_Selective_Accept, Select_Sloc);
Set_Select_Alternatives (Select_Node, Alt_List);
-- Scan out selective accept alternatives. On entry to this loop,
-- we are just past a SELECT or OR token, and any pragmas that
-- immediately follow the SELECT or OR are in Alt_Pragmas.
loop
if Token = Tok_When then
if Present (Alt_Pragmas) then
Error_Msg_SC ("pragmas may not precede guard");
end if;
Scan; -- past WHEN
Cond_Expr := P_Expression_No_Right_Paren;
T_Arrow;
Alt_Pragmas := P_Pragmas_Opt;
else
Cond_Expr := Empty;
end if;
if Token = Tok_Accept then
Alternative := P_Accept_Alternative;
-- Check for junk attempt at asynchronous select using
-- an Accept alternative as the triggering statement
if Token = Tok_Abort
and then Is_Empty_List (Alt_List)
and then No (Cond_Expr)
then
Error_Msg
("triggering statement must be entry call or delay",
Sloc (Alternative));
Scan; -- past junk ABORT
Discard_Junk_List (P_Sequence_Of_Statements (SS_Sreq));
End_Statements;
return Error;
end if;
elsif Token = Tok_Delay then
Alternative := P_Delay_Alternative;
elsif Token = Tok_Terminate then
Alternative := P_Terminate_Alternative;
else
Error_Msg_SC
("select alternative (ACCEPT, ABORT, DELAY) expected");
Alternative := Error;
if Token = Tok_Semicolon then
Scan; -- past junk semicolon
end if;
end if;
-- THEN ABORT at this stage is just junk
if Token = Tok_Abort then
Error_Msg_SP ("misplaced `THEN ABORT`");
Scan; -- past junk ABORT
Discard_Junk_List (P_Sequence_Of_Statements (SS_Sreq));
End_Statements;
return Error;
else
if Alternative /= Error then
Set_Condition (Alternative, Cond_Expr);
Set_Pragmas_Before (Alternative, Alt_Pragmas);
Append (Alternative, Alt_List);
end if;
exit when Token /= Tok_Or;
end if;
T_Or;
Alt_Pragmas := P_Pragmas_Opt;
end loop;
if Token = Tok_Else then
Scan; -- past ELSE
Set_Else_Statements
(Select_Node, P_Sequence_Of_Statements (SS_Ortm_Sreq));
if Token = Tok_Or then
Error_Msg_SC ("select alternative cannot follow else part!");
end if;
end if;
End_Statements;
end if;
return Select_Node;
end P_Select_Statement;
-----------------------------
-- 9.7.1 Selective Accept --
-----------------------------
-- Parsed by P_Select_Statement (9.7)
------------------
-- 9.7.1 Guard --
------------------
-- Parsed by P_Select_Statement (9.7)
-------------------------------
-- 9.7.1 Select Alternative --
-------------------------------
-- SELECT_ALTERNATIVE ::=
-- ACCEPT_ALTERNATIVE
-- | DELAY_ALTERNATIVE
-- | TERMINATE_ALTERNATIVE
-- Note: the guard preceding a select alternative is included as part
-- of the node generated for a selective accept alternative.
-- Error recovery: cannot raise Error_Resync
-------------------------------
-- 9.7.1 Accept Alternative --
-------------------------------
-- ACCEPT_ALTERNATIVE ::=
-- ACCEPT_STATEMENT [SEQUENCE_OF_STATEMENTS]
-- Error_Recovery: Cannot raise Error_Resync
-- Note: the caller is responsible for setting the Pragmas_Before
-- field of the returned N_Terminate_Alternative node.
function P_Accept_Alternative return Node_Id is
Accept_Alt_Node : Node_Id;
begin
Accept_Alt_Node := New_Node (N_Accept_Alternative, Token_Ptr);
Set_Accept_Statement (Accept_Alt_Node, P_Accept_Statement);
-- Note: the reason that we accept THEN ABORT as a terminator for
-- the sequence of statements is for error recovery which allows
-- for misuse of an accept statement as a triggering statement.
Set_Statements
(Accept_Alt_Node, P_Sequence_Of_Statements (SS_Eltm_Ortm_Tatm));
return Accept_Alt_Node;
end P_Accept_Alternative;
------------------------------
-- 9.7.1 Delay Alternative --
------------------------------
-- DELAY_ALTERNATIVE ::=
-- DELAY_STATEMENT [SEQUENCE_OF_STATEMENTS]
-- Error_Recovery: Cannot raise Error_Resync
-- Note: the caller is responsible for setting the Pragmas_Before
-- field of the returned N_Terminate_Alternative node.
function P_Delay_Alternative return Node_Id is
Delay_Alt_Node : Node_Id;
begin
Delay_Alt_Node := New_Node (N_Delay_Alternative, Token_Ptr);
Set_Delay_Statement (Delay_Alt_Node, P_Delay_Statement);
-- Note: the reason that we accept THEN ABORT as a terminator for
-- the sequence of statements is for error recovery which allows
-- for misuse of an accept statement as a triggering statement.
Set_Statements
(Delay_Alt_Node, P_Sequence_Of_Statements (SS_Eltm_Ortm_Tatm));
return Delay_Alt_Node;
end P_Delay_Alternative;
----------------------------------
-- 9.7.1 Terminate Alternative --
----------------------------------
-- TERMINATE_ALTERNATIVE ::= terminate;
-- Error_Recovery: Cannot raise Error_Resync
-- Note: the caller is responsible for setting the Pragmas_Before
-- field of the returned N_Terminate_Alternative node.
function P_Terminate_Alternative return Node_Id is
Terminate_Alt_Node : Node_Id;
begin
Terminate_Alt_Node := New_Node (N_Terminate_Alternative, Token_Ptr);
Scan; -- past TERMINATE
TF_Semicolon;
-- For all other select alternatives, the sequence of statements
-- after the alternative statement will swallow up any pragmas
-- coming in this position. But the terminate alternative has no
-- sequence of statements, so the pragmas here must be treated
-- specially.
Set_Pragmas_After (Terminate_Alt_Node, P_Pragmas_Opt);
return Terminate_Alt_Node;
end P_Terminate_Alternative;
-----------------------------
-- 9.7.2 Timed Entry Call --
-----------------------------
-- Parsed by P_Select_Statement (9.7)
-----------------------------------
-- 9.7.2 Entry Call Alternative --
-----------------------------------
-- Parsed by P_Select_Statement (9.7)
-----------------------------------
-- 9.7.3 Conditional Entry Call --
-----------------------------------
-- Parsed by P_Select_Statement (9.7)
--------------------------------
-- 9.7.4 Asynchronous Select --
--------------------------------
-- Parsed by P_Select_Statement (9.7)
-----------------------------------
-- 9.7.4 Triggering Alternative --
-----------------------------------
-- Parsed by P_Select_Statement (9.7)
---------------------------------
-- 9.7.4 Triggering Statement --
---------------------------------
-- Parsed by P_Select_Statement (9.7)
---------------------------
-- 9.7.4 Abortable Part --
---------------------------
-- ABORTABLE_PART ::= SEQUENCE_OF_STATEMENTS
-- The caller has verified that THEN ABORT is present, and Token is
-- pointing to the ABORT on entry (or if not, then we have an error)
-- Error recovery: cannot raise Error_Resync
function P_Abortable_Part return Node_Id is
Abortable_Part_Node : Node_Id;
begin
Abortable_Part_Node := New_Node (N_Abortable_Part, Token_Ptr);
T_Abort; -- scan past ABORT
if Ada_Version = Ada_83 then
Error_Msg_SP ("(Ada 83) asynchronous select not allowed!");
end if;
Set_Statements (Abortable_Part_Node, P_Sequence_Of_Statements (SS_Sreq));
return Abortable_Part_Node;
end P_Abortable_Part;
--------------------------
-- 9.8 Abort Statement --
--------------------------
-- ABORT_STATEMENT ::= abort task_NAME {, task_NAME};
-- The caller has checked that the initial token is ABORT
-- Error recovery: cannot raise Error_Resync
function P_Abort_Statement return Node_Id is
Abort_Node : Node_Id;
begin
Abort_Node := New_Node (N_Abort_Statement, Token_Ptr);
Scan; -- past ABORT
Set_Names (Abort_Node, New_List);
loop
Append (P_Name, Names (Abort_Node));
exit when Token /= Tok_Comma;
Scan; -- past comma
end loop;
TF_Semicolon;
return Abort_Node;
end P_Abort_Statement;
end Ch9;
|
--pragma SPARK_Mode;
with Interfaces.C; use Interfaces.C;
with System;
package body Zumo_Buzzer is
-- BuzzerFinished : Boolean := True;
procedure Enable_Timer_ISR (State : Boolean)
is
TIMSK2 : Unsigned_Char
with Address => System'To_Address (16#70#);
begin
if State then
TIMSK2 := 1;
else
TIMSK2 := 0;
end if;
end Enable_Timer_ISR;
procedure Init
is
TCCR2A : Unsigned_Char
with Address => System'To_Address (16#B0#);
TCCR2B : Unsigned_Char
with Address => System'To_Address (16#B1#);
OCR2A : Unsigned_Char
with Address => System'To_Address (16#B3#);
OCR2B : Unsigned_Char
with Address => System'To_Address (16#B4#);
DDRD : Unsigned_Char
with Address => System'To_Address (16#0A#);
begin
Initd := True;
Enable_Timer_ISR (State => False);
TCCR2A := 16#21#;
TCCR2B := 16#0B#;
-- OCR2A := (F_CPU / 64) / 1000;
OCR2B := 0;
DDRD := 4;
end Init;
procedure PlayFrequency (Freq : Frequency;
Dur : Duration;
Vol : Volume)
is
begin
null;
end PlayFrequency;
procedure PlayNote (Note : Integer;
Dur : Duration;
Vol : Volume)
is
begin
null;
end PlayNote;
function PlayCheck return Boolean
is
begin
return False;
end PlayCheck;
function IsPlaying return Boolean
is
begin
return False;
end IsPlaying;
procedure StopPlaying
is
begin
null;
end StopPlaying;
end Zumo_Buzzer;
|
------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- G N A T . S P I T B O L --
-- --
-- B o d y --
-- --
-- Copyright (C) 1998-2016, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- 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.Strings; use Ada.Strings;
with Ada.Strings.Unbounded.Aux; use Ada.Strings.Unbounded.Aux;
with GNAT.Debug_Utilities; use GNAT.Debug_Utilities;
with GNAT.IO; use GNAT.IO;
with System.String_Hash;
with Ada.Unchecked_Deallocation;
package body GNAT.Spitbol is
---------
-- "&" --
---------
function "&" (Num : Integer; Str : String) return String is
begin
return S (Num) & Str;
end "&";
function "&" (Str : String; Num : Integer) return String is
begin
return Str & S (Num);
end "&";
function "&" (Num : Integer; Str : VString) return VString is
begin
return S (Num) & Str;
end "&";
function "&" (Str : VString; Num : Integer) return VString is
begin
return Str & S (Num);
end "&";
----------
-- Char --
----------
function Char (Num : Natural) return Character is
begin
return Character'Val (Num);
end Char;
----------
-- Lpad --
----------
function Lpad
(Str : VString;
Len : Natural;
Pad : Character := ' ') return VString
is
begin
if Length (Str) >= Len then
return Str;
else
return Tail (Str, Len, Pad);
end if;
end Lpad;
function Lpad
(Str : String;
Len : Natural;
Pad : Character := ' ') return VString
is
begin
if Str'Length >= Len then
return V (Str);
else
declare
R : String (1 .. Len);
begin
for J in 1 .. Len - Str'Length loop
R (J) := Pad;
end loop;
R (Len - Str'Length + 1 .. Len) := Str;
return V (R);
end;
end if;
end Lpad;
procedure Lpad
(Str : in out VString;
Len : Natural;
Pad : Character := ' ')
is
begin
if Length (Str) >= Len then
return;
else
Tail (Str, Len, Pad);
end if;
end Lpad;
-------
-- N --
-------
function N (Str : VString) return Integer is
S : Big_String_Access;
L : Natural;
begin
Get_String (Str, S, L);
return Integer'Value (S (1 .. L));
end N;
--------------------
-- Reverse_String --
--------------------
function Reverse_String (Str : VString) return VString is
S : Big_String_Access;
L : Natural;
begin
Get_String (Str, S, L);
declare
Result : String (1 .. L);
begin
for J in 1 .. L loop
Result (J) := S (L + 1 - J);
end loop;
return V (Result);
end;
end Reverse_String;
function Reverse_String (Str : String) return VString is
Result : String (1 .. Str'Length);
begin
for J in 1 .. Str'Length loop
Result (J) := Str (Str'Last + 1 - J);
end loop;
return V (Result);
end Reverse_String;
procedure Reverse_String (Str : in out VString) is
S : Big_String_Access;
L : Natural;
begin
Get_String (Str, S, L);
declare
Result : String (1 .. L);
begin
for J in 1 .. L loop
Result (J) := S (L + 1 - J);
end loop;
Set_Unbounded_String (Str, Result);
end;
end Reverse_String;
----------
-- Rpad --
----------
function Rpad
(Str : VString;
Len : Natural;
Pad : Character := ' ') return VString
is
begin
if Length (Str) >= Len then
return Str;
else
return Head (Str, Len, Pad);
end if;
end Rpad;
function Rpad
(Str : String;
Len : Natural;
Pad : Character := ' ') return VString
is
begin
if Str'Length >= Len then
return V (Str);
else
declare
R : String (1 .. Len);
begin
for J in Str'Length + 1 .. Len loop
R (J) := Pad;
end loop;
R (1 .. Str'Length) := Str;
return V (R);
end;
end if;
end Rpad;
procedure Rpad
(Str : in out VString;
Len : Natural;
Pad : Character := ' ')
is
begin
if Length (Str) >= Len then
return;
else
Head (Str, Len, Pad);
end if;
end Rpad;
-------
-- S --
-------
function S (Num : Integer) return String is
Buf : String (1 .. 30);
Ptr : Natural := Buf'Last + 1;
Val : Natural := abs (Num);
begin
loop
Ptr := Ptr - 1;
Buf (Ptr) := Character'Val (Val mod 10 + Character'Pos ('0'));
Val := Val / 10;
exit when Val = 0;
end loop;
if Num < 0 then
Ptr := Ptr - 1;
Buf (Ptr) := '-';
end if;
return Buf (Ptr .. Buf'Last);
end S;
------------
-- Substr --
------------
function Substr
(Str : VString;
Start : Positive;
Len : Natural) return VString
is
S : Big_String_Access;
L : Natural;
begin
Get_String (Str, S, L);
if Start > L then
raise Index_Error;
elsif Start + Len - 1 > L then
raise Length_Error;
else
return V (S (Start .. Start + Len - 1));
end if;
end Substr;
function Substr
(Str : String;
Start : Positive;
Len : Natural) return VString
is
begin
if Start > Str'Length then
raise Index_Error;
elsif Start + Len - 1 > Str'Length then
raise Length_Error;
else
return
V (Str (Str'First + Start - 1 .. Str'First + Start + Len - 2));
end if;
end Substr;
-----------
-- Table --
-----------
package body Table is
procedure Free is new
Ada.Unchecked_Deallocation (Hash_Element, Hash_Element_Ptr);
-----------------------
-- Local Subprograms --
-----------------------
function Hash is new System.String_Hash.Hash
(Character, String, Unsigned_32);
------------
-- Adjust --
------------
overriding procedure Adjust (Object : in out Table) is
Ptr1 : Hash_Element_Ptr;
Ptr2 : Hash_Element_Ptr;
begin
for J in Object.Elmts'Range loop
Ptr1 := Object.Elmts (J)'Unrestricted_Access;
if Ptr1.Name /= null then
loop
Ptr1.Name := new String'(Ptr1.Name.all);
exit when Ptr1.Next = null;
Ptr2 := Ptr1.Next;
Ptr1.Next := new Hash_Element'(Ptr2.all);
Ptr1 := Ptr1.Next;
end loop;
end if;
end loop;
end Adjust;
-----------
-- Clear --
-----------
procedure Clear (T : in out Table) is
Ptr1 : Hash_Element_Ptr;
Ptr2 : Hash_Element_Ptr;
begin
for J in T.Elmts'Range loop
if T.Elmts (J).Name /= null then
Free (T.Elmts (J).Name);
T.Elmts (J).Value := Null_Value;
Ptr1 := T.Elmts (J).Next;
T.Elmts (J).Next := null;
while Ptr1 /= null loop
Ptr2 := Ptr1.Next;
Free (Ptr1.Name);
Free (Ptr1);
Ptr1 := Ptr2;
end loop;
end if;
end loop;
end Clear;
----------------------
-- Convert_To_Array --
----------------------
function Convert_To_Array (T : Table) return Table_Array is
Num_Elmts : Natural := 0;
Elmt : Hash_Element_Ptr;
begin
for J in T.Elmts'Range loop
Elmt := T.Elmts (J)'Unrestricted_Access;
if Elmt.Name /= null then
loop
Num_Elmts := Num_Elmts + 1;
Elmt := Elmt.Next;
exit when Elmt = null;
end loop;
end if;
end loop;
declare
TA : Table_Array (1 .. Num_Elmts);
P : Natural := 1;
begin
for J in T.Elmts'Range loop
Elmt := T.Elmts (J)'Unrestricted_Access;
if Elmt.Name /= null then
loop
Set_Unbounded_String (TA (P).Name, Elmt.Name.all);
TA (P).Value := Elmt.Value;
P := P + 1;
Elmt := Elmt.Next;
exit when Elmt = null;
end loop;
end if;
end loop;
return TA;
end;
end Convert_To_Array;
----------
-- Copy --
----------
procedure Copy (From : Table; To : in out Table) is
Elmt : Hash_Element_Ptr;
begin
Clear (To);
for J in From.Elmts'Range loop
Elmt := From.Elmts (J)'Unrestricted_Access;
if Elmt.Name /= null then
loop
Set (To, Elmt.Name.all, Elmt.Value);
Elmt := Elmt.Next;
exit when Elmt = null;
end loop;
end if;
end loop;
end Copy;
------------
-- Delete --
------------
procedure Delete (T : in out Table; Name : Character) is
begin
Delete (T, String'(1 => Name));
end Delete;
procedure Delete (T : in out Table; Name : VString) is
S : Big_String_Access;
L : Natural;
begin
Get_String (Name, S, L);
Delete (T, S (1 .. L));
end Delete;
procedure Delete (T : in out Table; Name : String) is
Slot : constant Unsigned_32 := Hash (Name) mod T.N + 1;
Elmt : Hash_Element_Ptr := T.Elmts (Slot)'Unrestricted_Access;
Next : Hash_Element_Ptr;
begin
if Elmt.Name = null then
null;
elsif Elmt.Name.all = Name then
Free (Elmt.Name);
if Elmt.Next = null then
Elmt.Value := Null_Value;
return;
else
Next := Elmt.Next;
Elmt.Name := Next.Name;
Elmt.Value := Next.Value;
Elmt.Next := Next.Next;
Free (Next);
return;
end if;
else
loop
Next := Elmt.Next;
if Next = null then
return;
elsif Next.Name.all = Name then
Free (Next.Name);
Elmt.Next := Next.Next;
Free (Next);
return;
else
Elmt := Next;
end if;
end loop;
end if;
end Delete;
----------
-- Dump --
----------
procedure Dump (T : Table; Str : String := "Table") is
Num_Elmts : Natural := 0;
Elmt : Hash_Element_Ptr;
begin
for J in T.Elmts'Range loop
Elmt := T.Elmts (J)'Unrestricted_Access;
if Elmt.Name /= null then
loop
Num_Elmts := Num_Elmts + 1;
Put_Line
(Str & '<' & Image (Elmt.Name.all) & "> = " &
Img (Elmt.Value));
Elmt := Elmt.Next;
exit when Elmt = null;
end loop;
end if;
end loop;
if Num_Elmts = 0 then
Put_Line (Str & " is empty");
end if;
end Dump;
procedure Dump (T : Table_Array; Str : String := "Table_Array") is
begin
if T'Length = 0 then
Put_Line (Str & " is empty");
else
for J in T'Range loop
Put_Line
(Str & '(' & Image (To_String (T (J).Name)) & ") = " &
Img (T (J).Value));
end loop;
end if;
end Dump;
--------------
-- Finalize --
--------------
overriding procedure Finalize (Object : in out Table) is
Ptr1 : Hash_Element_Ptr;
Ptr2 : Hash_Element_Ptr;
begin
for J in Object.Elmts'Range loop
Ptr1 := Object.Elmts (J).Next;
Free (Object.Elmts (J).Name);
while Ptr1 /= null loop
Ptr2 := Ptr1.Next;
Free (Ptr1.Name);
Free (Ptr1);
Ptr1 := Ptr2;
end loop;
end loop;
end Finalize;
---------
-- Get --
---------
function Get (T : Table; Name : Character) return Value_Type is
begin
return Get (T, String'(1 => Name));
end Get;
function Get (T : Table; Name : VString) return Value_Type is
S : Big_String_Access;
L : Natural;
begin
Get_String (Name, S, L);
return Get (T, S (1 .. L));
end Get;
function Get (T : Table; Name : String) return Value_Type is
Slot : constant Unsigned_32 := Hash (Name) mod T.N + 1;
Elmt : Hash_Element_Ptr := T.Elmts (Slot)'Unrestricted_Access;
begin
if Elmt.Name = null then
return Null_Value;
else
loop
if Name = Elmt.Name.all then
return Elmt.Value;
else
Elmt := Elmt.Next;
if Elmt = null then
return Null_Value;
end if;
end if;
end loop;
end if;
end Get;
-------------
-- Present --
-------------
function Present (T : Table; Name : Character) return Boolean is
begin
return Present (T, String'(1 => Name));
end Present;
function Present (T : Table; Name : VString) return Boolean is
S : Big_String_Access;
L : Natural;
begin
Get_String (Name, S, L);
return Present (T, S (1 .. L));
end Present;
function Present (T : Table; Name : String) return Boolean is
Slot : constant Unsigned_32 := Hash (Name) mod T.N + 1;
Elmt : Hash_Element_Ptr := T.Elmts (Slot)'Unrestricted_Access;
begin
if Elmt.Name = null then
return False;
else
loop
if Name = Elmt.Name.all then
return True;
else
Elmt := Elmt.Next;
if Elmt = null then
return False;
end if;
end if;
end loop;
end if;
end Present;
---------
-- Set --
---------
procedure Set (T : in out Table; Name : VString; Value : Value_Type) is
S : Big_String_Access;
L : Natural;
begin
Get_String (Name, S, L);
Set (T, S (1 .. L), Value);
end Set;
procedure Set (T : in out Table; Name : Character; Value : Value_Type) is
begin
Set (T, String'(1 => Name), Value);
end Set;
procedure Set
(T : in out Table;
Name : String;
Value : Value_Type)
is
begin
if Value = Null_Value then
Delete (T, Name);
else
declare
Slot : constant Unsigned_32 := Hash (Name) mod T.N + 1;
Elmt : Hash_Element_Ptr := T.Elmts (Slot)'Unrestricted_Access;
subtype String1 is String (1 .. Name'Length);
begin
if Elmt.Name = null then
Elmt.Name := new String'(String1 (Name));
Elmt.Value := Value;
return;
else
loop
if Name = Elmt.Name.all then
Elmt.Value := Value;
return;
elsif Elmt.Next = null then
Elmt.Next := new Hash_Element'(
Name => new String'(String1 (Name)),
Value => Value,
Next => null);
return;
else
Elmt := Elmt.Next;
end if;
end loop;
end if;
end;
end if;
end Set;
end Table;
----------
-- Trim --
----------
function Trim (Str : VString) return VString is
begin
return Trim (Str, Right);
end Trim;
function Trim (Str : String) return VString is
begin
for J in reverse Str'Range loop
if Str (J) /= ' ' then
return V (Str (Str'First .. J));
end if;
end loop;
return Nul;
end Trim;
procedure Trim (Str : in out VString) is
begin
Trim (Str, Right);
end Trim;
-------
-- V --
-------
function V (Num : Integer) return VString is
Buf : String (1 .. 30);
Ptr : Natural := Buf'Last + 1;
Val : Natural := abs (Num);
begin
loop
Ptr := Ptr - 1;
Buf (Ptr) := Character'Val (Val mod 10 + Character'Pos ('0'));
Val := Val / 10;
exit when Val = 0;
end loop;
if Num < 0 then
Ptr := Ptr - 1;
Buf (Ptr) := '-';
end if;
return V (Buf (Ptr .. Buf'Last));
end V;
end GNAT.Spitbol;
|
-- Copyright 2012-2020 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package Pck is
procedure Do_Nothing;
end Pck;
|
new \
|
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Form_Demo.Handler --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer <Juergen.Pfeifer@T-Online.de> 1996
-- Version Control
-- $Revision: 1.5 $
-- Binding Version 00.93
------------------------------------------------------------------------------
with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
with Sample.Form_Demo.Aux;
with Sample.Explanation; use Sample.Explanation;
package body Sample.Form_Demo.Handler is
package Aux renames Sample.Form_Demo.Aux;
procedure Drive_Me (F : in Form;
Title : in String := "")
is
L : Line_Count;
C : Column_Count;
Y : Line_Position;
X : Column_Position;
begin
Aux.Geometry (F, L, C, Y, X);
Drive_Me (F, Y, X, Title);
end Drive_Me;
procedure Drive_Me (F : in Form;
Lin : in Line_Position;
Col : in Column_Position;
Title : in String := "")
is
Pan : Panel := Aux.Create (F, Title, Lin, Col);
V : Cursor_Visibility := Normal;
Handle_CRLF : Boolean := True;
begin
Set_Cursor_Visibility (V);
if Aux.Count_Active (F) = 1 then
Handle_CRLF := False;
end if;
loop
declare
K : Key_Code := Aux.Get_Request (F, Pan, Handle_CRLF);
R : Driver_Result;
begin
if (K = 13 or else K = 10) and then not Handle_CRLF then
R := Unknown_Request;
else
R := Driver (F, K);
end if;
case R is
when Form_Ok => null;
when Unknown_Request =>
if My_Driver (F, K, Pan) then
exit;
end if;
when others => Beep;
end case;
end;
end loop;
Set_Cursor_Visibility (V);
Aux.Destroy (F, Pan);
end Drive_Me;
end Sample.Form_Demo.Handler;
|
-- Copyright 2011-2017 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Pck; use Pck;
procedure Foo is
begin
Call_Me (50);
end Foo;
|
-- Copyright 2013-2014 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Pck; use Pck;
procedure Foo is
type Multi is array (1 .. 1, 2 .. 3, 4 .. 6) of Integer;
M : Multi := (others => (others => (others => 0)));
-- Use a fake type for importing our C multi-dimensional array.
-- It's only to make sure the C unit gets linked in, regardless
-- of possible optimizations.
type Void_Star is access integer;
E : Void_Star;
pragma Import (C, E, "global_3dim_for_gdb_testing");
begin
Do_Nothing (M'Address); -- STOP
Do_Nothing (E'Address);
end Foo;
|
-------------------------------------------------------------------------------
-- This file is part of libsparkcrypto.
--
-- Copyright (C) 2010, Alexander Senier
-- Copyright (C) 2010, secunet Security Networks AG
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
--
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
--
-- * Neither the name of the nor the names of its contributors may be used
-- to endorse or promote products derived from this software without
-- specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
-- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Debug package
--
-- Debug is done through Debug pragmas. As the compiler has to with the debug
-- package to make it available to this pragma, this is an empty package which
-- makes the SPARK Examiner accept the respective with clause. Debug functions,
-- however, cannot (and should not) be use from within SPARK.
-------------------------------------------------------------------------------
package LSC.Internal.Debug
is
pragma Pure;
end LSC.Internal.Debug;
|
-- Some UDC will skip the Status_Out ZLP if a new setup request is received
-- quickly. This test checks that the Device Stack can handle it.
with USB_Testing; use USB_Testing;
with USB_Testing.UDC_Stub; use USB_Testing.UDC_Stub;
with USB_Testing.UDC_Scenarios;
with HAL; use HAL;
with USB.HAL.Device; use USB.HAL.Device;
with USB; use USB;
procedure Main is
Scenario : aliased constant UDC_Stub.Stub_Scenario :=
UDC_Scenarios.Enumeration (Verbose => False) &
Stub_Scenario'(1 => (Kind => Set_Verbose, Verbose => False),
2 => (Kind => UDC_Event_E,
Evt => (Kind => Setup_Request,
-- Get Device descriptor
Req => ((Dev, 0, Stand, Device_To_Host),
6, 16#0100#, 0, 64),
Req_EP => 0)),
-- Do NOT ACK the IN transfer with a ZLP, but send another
-- request instead.
3 => (Kind => Set_Verbose, Verbose => True),
4 => (Kind => UDC_Event_E,
Evt => (Kind => Setup_Request,
-- Get Device descriptor
Req => ((Dev, 0, Stand, Device_To_Host),
6, 16#0100#, 0, 64),
Req_EP => 0))
);
RX_Data : aliased constant UInt8_Array := (0 .. 1 => 0);
begin
USB_Testing.UDC_Scenarios.Basic_UDC_Test (Scenario,
RX_Data,
Early_Address => False);
end Main;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . S T R I N G S . W I D E _ W I D E _ U N B O U N D E D --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ada.Strings.Wide_Wide_Fixed;
with Ada.Strings.Wide_Wide_Search;
with Ada.Unchecked_Deallocation;
package body Ada.Strings.Wide_Wide_Unbounded is
use Ada.Finalization;
---------
-- "&" --
---------
function "&"
(Left : Unbounded_Wide_Wide_String;
Right : Unbounded_Wide_Wide_String) return Unbounded_Wide_Wide_String
is
L_Length : constant Natural := Left.Last;
R_Length : constant Natural := Right.Last;
Result : Unbounded_Wide_Wide_String;
begin
Result.Last := L_Length + R_Length;
Result.Reference := new Wide_Wide_String (1 .. Result.Last);
Result.Reference (1 .. L_Length) :=
Left.Reference (1 .. Left.Last);
Result.Reference (L_Length + 1 .. Result.Last) :=
Right.Reference (1 .. Right.Last);
return Result;
end "&";
function "&"
(Left : Unbounded_Wide_Wide_String;
Right : Wide_Wide_String) return Unbounded_Wide_Wide_String
is
L_Length : constant Natural := Left.Last;
Result : Unbounded_Wide_Wide_String;
begin
Result.Last := L_Length + Right'Length;
Result.Reference := new Wide_Wide_String (1 .. Result.Last);
Result.Reference (1 .. L_Length) := Left.Reference (1 .. Left.Last);
Result.Reference (L_Length + 1 .. Result.Last) := Right;
return Result;
end "&";
function "&"
(Left : Wide_Wide_String;
Right : Unbounded_Wide_Wide_String) return Unbounded_Wide_Wide_String
is
R_Length : constant Natural := Right.Last;
Result : Unbounded_Wide_Wide_String;
begin
Result.Last := Left'Length + R_Length;
Result.Reference := new Wide_Wide_String (1 .. Result.Last);
Result.Reference (1 .. Left'Length) := Left;
Result.Reference (Left'Length + 1 .. Result.Last) :=
Right.Reference (1 .. Right.Last);
return Result;
end "&";
function "&"
(Left : Unbounded_Wide_Wide_String;
Right : Wide_Wide_Character) return Unbounded_Wide_Wide_String
is
Result : Unbounded_Wide_Wide_String;
begin
Result.Last := Left.Last + 1;
Result.Reference := new Wide_Wide_String (1 .. Result.Last);
Result.Reference (1 .. Result.Last - 1) :=
Left.Reference (1 .. Left.Last);
Result.Reference (Result.Last) := Right;
return Result;
end "&";
function "&"
(Left : Wide_Wide_Character;
Right : Unbounded_Wide_Wide_String) return Unbounded_Wide_Wide_String
is
Result : Unbounded_Wide_Wide_String;
begin
Result.Last := Right.Last + 1;
Result.Reference := new Wide_Wide_String (1 .. Result.Last);
Result.Reference (1) := Left;
Result.Reference (2 .. Result.Last) :=
Right.Reference (1 .. Right.Last);
return Result;
end "&";
---------
-- "*" --
---------
function "*"
(Left : Natural;
Right : Wide_Wide_Character) return Unbounded_Wide_Wide_String
is
Result : Unbounded_Wide_Wide_String;
begin
Result.Last := Left;
Result.Reference := new Wide_Wide_String (1 .. Left);
for J in Result.Reference'Range loop
Result.Reference (J) := Right;
end loop;
return Result;
end "*";
function "*"
(Left : Natural;
Right : Wide_Wide_String) return Unbounded_Wide_Wide_String
is
Len : constant Natural := Right'Length;
K : Positive;
Result : Unbounded_Wide_Wide_String;
begin
Result.Last := Left * Len;
Result.Reference := new Wide_Wide_String (1 .. Result.Last);
K := 1;
for J in 1 .. Left loop
Result.Reference (K .. K + Len - 1) := Right;
K := K + Len;
end loop;
return Result;
end "*";
function "*"
(Left : Natural;
Right : Unbounded_Wide_Wide_String) return Unbounded_Wide_Wide_String
is
Len : constant Natural := Right.Last;
K : Positive;
Result : Unbounded_Wide_Wide_String;
begin
Result.Last := Left * Len;
Result.Reference := new Wide_Wide_String (1 .. Result.Last);
K := 1;
for J in 1 .. Left loop
Result.Reference (K .. K + Len - 1) :=
Right.Reference (1 .. Right.Last);
K := K + Len;
end loop;
return Result;
end "*";
---------
-- "<" --
---------
function "<"
(Left : Unbounded_Wide_Wide_String;
Right : Unbounded_Wide_Wide_String) return Boolean
is
begin
return
Left.Reference (1 .. Left.Last) < Right.Reference (1 .. Right.Last);
end "<";
function "<"
(Left : Unbounded_Wide_Wide_String;
Right : Wide_Wide_String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) < Right;
end "<";
function "<"
(Left : Wide_Wide_String;
Right : Unbounded_Wide_Wide_String) return Boolean
is
begin
return Left < Right.Reference (1 .. Right.Last);
end "<";
----------
-- "<=" --
----------
function "<="
(Left : Unbounded_Wide_Wide_String;
Right : Unbounded_Wide_Wide_String) return Boolean
is
begin
return
Left.Reference (1 .. Left.Last) <= Right.Reference (1 .. Right.Last);
end "<=";
function "<="
(Left : Unbounded_Wide_Wide_String;
Right : Wide_Wide_String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) <= Right;
end "<=";
function "<="
(Left : Wide_Wide_String;
Right : Unbounded_Wide_Wide_String) return Boolean
is
begin
return Left <= Right.Reference (1 .. Right.Last);
end "<=";
---------
-- "=" --
---------
function "="
(Left : Unbounded_Wide_Wide_String;
Right : Unbounded_Wide_Wide_String) return Boolean
is
begin
return
Left.Reference (1 .. Left.Last) = Right.Reference (1 .. Right.Last);
end "=";
function "="
(Left : Unbounded_Wide_Wide_String;
Right : Wide_Wide_String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) = Right;
end "=";
function "="
(Left : Wide_Wide_String;
Right : Unbounded_Wide_Wide_String) return Boolean
is
begin
return Left = Right.Reference (1 .. Right.Last);
end "=";
---------
-- ">" --
---------
function ">"
(Left : Unbounded_Wide_Wide_String;
Right : Unbounded_Wide_Wide_String) return Boolean
is
begin
return
Left.Reference (1 .. Left.Last) > Right.Reference (1 .. Right.Last);
end ">";
function ">"
(Left : Unbounded_Wide_Wide_String;
Right : Wide_Wide_String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) > Right;
end ">";
function ">"
(Left : Wide_Wide_String;
Right : Unbounded_Wide_Wide_String) return Boolean
is
begin
return Left > Right.Reference (1 .. Right.Last);
end ">";
----------
-- ">=" --
----------
function ">="
(Left : Unbounded_Wide_Wide_String;
Right : Unbounded_Wide_Wide_String) return Boolean
is
begin
return
Left.Reference (1 .. Left.Last) >= Right.Reference (1 .. Right.Last);
end ">=";
function ">="
(Left : Unbounded_Wide_Wide_String;
Right : Wide_Wide_String) return Boolean
is
begin
return Left.Reference (1 .. Left.Last) >= Right;
end ">=";
function ">="
(Left : Wide_Wide_String;
Right : Unbounded_Wide_Wide_String) return Boolean
is
begin
return Left >= Right.Reference (1 .. Right.Last);
end ">=";
------------
-- Adjust --
------------
procedure Adjust (Object : in out Unbounded_Wide_Wide_String) is
begin
-- Copy string, except we do not copy the statically allocated null
-- string, since it can never be deallocated. Note that we do not copy
-- extra string room here to avoid dragging unused allocated memory.
if Object.Reference /= Null_Wide_Wide_String'Access then
Object.Reference :=
new Wide_Wide_String'(Object.Reference (1 .. Object.Last));
end if;
end Adjust;
------------
-- Append --
------------
procedure Append
(Source : in out Unbounded_Wide_Wide_String;
New_Item : Unbounded_Wide_Wide_String)
is
begin
Realloc_For_Chunk (Source, New_Item.Last);
Source.Reference (Source.Last + 1 .. Source.Last + New_Item.Last) :=
New_Item.Reference (1 .. New_Item.Last);
Source.Last := Source.Last + New_Item.Last;
end Append;
procedure Append
(Source : in out Unbounded_Wide_Wide_String;
New_Item : Wide_Wide_String)
is
begin
Realloc_For_Chunk (Source, New_Item'Length);
Source.Reference (Source.Last + 1 .. Source.Last + New_Item'Length) :=
New_Item;
Source.Last := Source.Last + New_Item'Length;
end Append;
procedure Append
(Source : in out Unbounded_Wide_Wide_String;
New_Item : Wide_Wide_Character)
is
begin
Realloc_For_Chunk (Source, 1);
Source.Reference (Source.Last + 1) := New_Item;
Source.Last := Source.Last + 1;
end Append;
-----------
-- Count --
-----------
function Count
(Source : Unbounded_Wide_Wide_String;
Pattern : Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
Wide_Wide_Maps.Identity) return Natural
is
begin
return
Wide_Wide_Search.Count
(Source.Reference (1 .. Source.Last), Pattern, Mapping);
end Count;
function Count
(Source : Unbounded_Wide_Wide_String;
Pattern : Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Natural
is
begin
return
Wide_Wide_Search.Count
(Source.Reference (1 .. Source.Last), Pattern, Mapping);
end Count;
function Count
(Source : Unbounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set) return Natural
is
begin
return
Wide_Wide_Search.Count
(Source.Reference (1 .. Source.Last), Set);
end Count;
------------
-- Delete --
------------
function Delete
(Source : Unbounded_Wide_Wide_String;
From : Positive;
Through : Natural) return Unbounded_Wide_Wide_String
is
begin
return
To_Unbounded_Wide_Wide_String
(Wide_Wide_Fixed.Delete
(Source.Reference (1 .. Source.Last), From, Through));
end Delete;
procedure Delete
(Source : in out Unbounded_Wide_Wide_String;
From : Positive;
Through : Natural)
is
begin
if From > Through then
null;
elsif From < Source.Reference'First or else Through > Source.Last then
raise Index_Error;
else
declare
Len : constant Natural := Through - From + 1;
begin
Source.Reference (From .. Source.Last - Len) :=
Source.Reference (Through + 1 .. Source.Last);
Source.Last := Source.Last - Len;
end;
end if;
end Delete;
-------------
-- Element --
-------------
function Element
(Source : Unbounded_Wide_Wide_String;
Index : Positive) return Wide_Wide_Character
is
begin
if Index <= Source.Last then
return Source.Reference (Index);
else
raise Strings.Index_Error;
end if;
end Element;
--------------
-- Finalize --
--------------
procedure Finalize (Object : in out Unbounded_Wide_Wide_String) is
procedure Deallocate is
new Ada.Unchecked_Deallocation
(Wide_Wide_String, Wide_Wide_String_Access);
begin
-- Note: Don't try to free statically allocated null string
if Object.Reference /= Null_Wide_Wide_String'Access then
Deallocate (Object.Reference);
Object.Reference := Null_Unbounded_Wide_Wide_String.Reference;
Object.Last := 0;
end if;
end Finalize;
----------------
-- Find_Token --
----------------
procedure Find_Token
(Source : Unbounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
From : Positive;
Test : Strings.Membership;
First : out Positive;
Last : out Natural)
is
begin
Wide_Wide_Search.Find_Token
(Source.Reference (From .. Source.Last), Set, Test, First, Last);
end Find_Token;
procedure Find_Token
(Source : Unbounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Strings.Membership;
First : out Positive;
Last : out Natural)
is
begin
Wide_Wide_Search.Find_Token
(Source.Reference (1 .. Source.Last), Set, Test, First, Last);
end Find_Token;
----------
-- Free --
----------
procedure Free (X : in out Wide_Wide_String_Access) is
procedure Deallocate is
new Ada.Unchecked_Deallocation
(Wide_Wide_String, Wide_Wide_String_Access);
begin
-- Note: Do not try to free statically allocated null string
if X /= Null_Unbounded_Wide_Wide_String.Reference then
Deallocate (X);
end if;
end Free;
----------
-- Head --
----------
function Head
(Source : Unbounded_Wide_Wide_String;
Count : Natural;
Pad : Wide_Wide_Character := Wide_Wide_Space)
return Unbounded_Wide_Wide_String
is
begin
return To_Unbounded_Wide_Wide_String
(Wide_Wide_Fixed.Head
(Source.Reference (1 .. Source.Last), Count, Pad));
end Head;
procedure Head
(Source : in out Unbounded_Wide_Wide_String;
Count : Natural;
Pad : Wide_Wide_Character := Wide_Wide_Space)
is
Old : Wide_Wide_String_Access := Source.Reference;
begin
Source.Reference :=
new Wide_Wide_String'
(Wide_Wide_Fixed.Head
(Source.Reference (1 .. Source.Last), Count, Pad));
Source.Last := Source.Reference'Length;
Free (Old);
end Head;
-----------
-- Index --
-----------
function Index
(Source : Unbounded_Wide_Wide_String;
Pattern : Wide_Wide_String;
Going : Strings.Direction := Strings.Forward;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
Wide_Wide_Maps.Identity) return Natural
is
begin
return
Wide_Wide_Search.Index
(Source.Reference (1 .. Source.Last), Pattern, Going, Mapping);
end Index;
function Index
(Source : Unbounded_Wide_Wide_String;
Pattern : Wide_Wide_String;
Going : Direction := Forward;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Natural
is
begin
return
Wide_Wide_Search.Index
(Source.Reference (1 .. Source.Last), Pattern, Going, Mapping);
end Index;
function Index
(Source : Unbounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Strings.Membership := Strings.Inside;
Going : Strings.Direction := Strings.Forward) return Natural
is
begin
return Wide_Wide_Search.Index
(Source.Reference (1 .. Source.Last), Set, Test, Going);
end Index;
function Index
(Source : Unbounded_Wide_Wide_String;
Pattern : Wide_Wide_String;
From : Positive;
Going : Direction := Forward;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
Wide_Wide_Maps.Identity) return Natural
is
begin
return
Wide_Wide_Search.Index
(Source.Reference (1 .. Source.Last), Pattern, From, Going, Mapping);
end Index;
function Index
(Source : Unbounded_Wide_Wide_String;
Pattern : Wide_Wide_String;
From : Positive;
Going : Direction := Forward;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Natural
is
begin
return
Wide_Wide_Search.Index
(Source.Reference (1 .. Source.Last), Pattern, From, Going, Mapping);
end Index;
function Index
(Source : Unbounded_Wide_Wide_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
From : Positive;
Test : Membership := Inside;
Going : Direction := Forward) return Natural
is
begin
return
Wide_Wide_Search.Index
(Source.Reference (1 .. Source.Last), Set, From, Test, Going);
end Index;
function Index_Non_Blank
(Source : Unbounded_Wide_Wide_String;
Going : Strings.Direction := Strings.Forward) return Natural
is
begin
return
Wide_Wide_Search.Index_Non_Blank
(Source.Reference (1 .. Source.Last), Going);
end Index_Non_Blank;
function Index_Non_Blank
(Source : Unbounded_Wide_Wide_String;
From : Positive;
Going : Direction := Forward) return Natural
is
begin
return
Wide_Wide_Search.Index_Non_Blank
(Source.Reference (1 .. Source.Last), From, Going);
end Index_Non_Blank;
----------------
-- Initialize --
----------------
procedure Initialize (Object : in out Unbounded_Wide_Wide_String) is
begin
Object.Reference := Null_Unbounded_Wide_Wide_String.Reference;
Object.Last := 0;
end Initialize;
------------
-- Insert --
------------
function Insert
(Source : Unbounded_Wide_Wide_String;
Before : Positive;
New_Item : Wide_Wide_String) return Unbounded_Wide_Wide_String
is
begin
return
To_Unbounded_Wide_Wide_String
(Wide_Wide_Fixed.Insert
(Source.Reference (1 .. Source.Last), Before, New_Item));
end Insert;
procedure Insert
(Source : in out Unbounded_Wide_Wide_String;
Before : Positive;
New_Item : Wide_Wide_String)
is
begin
if Before not in Source.Reference'First .. Source.Last + 1 then
raise Index_Error;
end if;
Realloc_For_Chunk (Source, New_Item'Length);
Source.Reference
(Before + New_Item'Length .. Source.Last + New_Item'Length) :=
Source.Reference (Before .. Source.Last);
Source.Reference (Before .. Before + New_Item'Length - 1) := New_Item;
Source.Last := Source.Last + New_Item'Length;
end Insert;
------------
-- Length --
------------
function Length (Source : Unbounded_Wide_Wide_String) return Natural is
begin
return Source.Last;
end Length;
---------------
-- Overwrite --
---------------
function Overwrite
(Source : Unbounded_Wide_Wide_String;
Position : Positive;
New_Item : Wide_Wide_String) return Unbounded_Wide_Wide_String
is
begin
return
To_Unbounded_Wide_Wide_String
(Wide_Wide_Fixed.Overwrite
(Source.Reference (1 .. Source.Last), Position, New_Item));
end Overwrite;
procedure Overwrite
(Source : in out Unbounded_Wide_Wide_String;
Position : Positive;
New_Item : Wide_Wide_String)
is
NL : constant Natural := New_Item'Length;
begin
if Position <= Source.Last - NL + 1 then
Source.Reference (Position .. Position + NL - 1) := New_Item;
else
declare
Old : Wide_Wide_String_Access := Source.Reference;
begin
Source.Reference := new Wide_Wide_String'
(Wide_Wide_Fixed.Overwrite
(Source.Reference (1 .. Source.Last), Position, New_Item));
Source.Last := Source.Reference'Length;
Free (Old);
end;
end if;
end Overwrite;
-----------------------
-- Realloc_For_Chunk --
-----------------------
procedure Realloc_For_Chunk
(Source : in out Unbounded_Wide_Wide_String;
Chunk_Size : Natural)
is
Growth_Factor : constant := 32;
-- The growth factor controls how much extra space is allocated when
-- we have to increase the size of an allocated unbounded string. By
-- allocating extra space, we avoid the need to reallocate on every
-- append, particularly important when a string is built up by repeated
-- append operations of small pieces. This is expressed as a factor so
-- 32 means add 1/32 of the length of the string as growth space.
Min_Mul_Alloc : constant := Standard'Maximum_Alignment;
-- Allocation will be done by a multiple of Min_Mul_Alloc This causes
-- no memory loss as most (all?) malloc implementations are obliged to
-- align the returned memory on the maximum alignment as malloc does not
-- know the target alignment.
S_Length : constant Natural := Source.Reference'Length;
begin
if Chunk_Size > S_Length - Source.Last then
declare
New_Size : constant Positive :=
S_Length + Chunk_Size + (S_Length / Growth_Factor);
New_Rounded_Up_Size : constant Positive :=
((New_Size - 1) / Min_Mul_Alloc + 1) * Min_Mul_Alloc;
Tmp : constant Wide_Wide_String_Access :=
new Wide_Wide_String (1 .. New_Rounded_Up_Size);
begin
Tmp (1 .. Source.Last) := Source.Reference (1 .. Source.Last);
Free (Source.Reference);
Source.Reference := Tmp;
end;
end if;
end Realloc_For_Chunk;
---------------------
-- Replace_Element --
---------------------
procedure Replace_Element
(Source : in out Unbounded_Wide_Wide_String;
Index : Positive;
By : Wide_Wide_Character)
is
begin
if Index <= Source.Last then
Source.Reference (Index) := By;
else
raise Strings.Index_Error;
end if;
end Replace_Element;
-------------------
-- Replace_Slice --
-------------------
function Replace_Slice
(Source : Unbounded_Wide_Wide_String;
Low : Positive;
High : Natural;
By : Wide_Wide_String) return Unbounded_Wide_Wide_String
is
begin
return To_Unbounded_Wide_Wide_String
(Wide_Wide_Fixed.Replace_Slice
(Source.Reference (1 .. Source.Last), Low, High, By));
end Replace_Slice;
procedure Replace_Slice
(Source : in out Unbounded_Wide_Wide_String;
Low : Positive;
High : Natural;
By : Wide_Wide_String)
is
Old : Wide_Wide_String_Access := Source.Reference;
begin
Source.Reference := new Wide_Wide_String'
(Wide_Wide_Fixed.Replace_Slice
(Source.Reference (1 .. Source.Last), Low, High, By));
Source.Last := Source.Reference'Length;
Free (Old);
end Replace_Slice;
------------------------------------
-- Set_Unbounded_Wide_Wide_String --
------------------------------------
procedure Set_Unbounded_Wide_Wide_String
(Target : out Unbounded_Wide_Wide_String;
Source : Wide_Wide_String)
is
begin
Target.Last := Source'Length;
Target.Reference := new Wide_Wide_String (1 .. Source'Length);
Target.Reference.all := Source;
end Set_Unbounded_Wide_Wide_String;
-----------
-- Slice --
-----------
function Slice
(Source : Unbounded_Wide_Wide_String;
Low : Positive;
High : Natural) return Wide_Wide_String
is
begin
-- Note: test of High > Length is in accordance with AI95-00128
if Low > Source.Last + 1 or else High > Source.Last then
raise Index_Error;
else
return Source.Reference (Low .. High);
end if;
end Slice;
----------
-- Tail --
----------
function Tail
(Source : Unbounded_Wide_Wide_String;
Count : Natural;
Pad : Wide_Wide_Character := Wide_Wide_Space)
return Unbounded_Wide_Wide_String is
begin
return To_Unbounded_Wide_Wide_String
(Wide_Wide_Fixed.Tail
(Source.Reference (1 .. Source.Last), Count, Pad));
end Tail;
procedure Tail
(Source : in out Unbounded_Wide_Wide_String;
Count : Natural;
Pad : Wide_Wide_Character := Wide_Wide_Space)
is
Old : Wide_Wide_String_Access := Source.Reference;
begin
Source.Reference := new Wide_Wide_String'
(Wide_Wide_Fixed.Tail
(Source.Reference (1 .. Source.Last), Count, Pad));
Source.Last := Source.Reference'Length;
Free (Old);
end Tail;
-----------------------------------
-- To_Unbounded_Wide_Wide_String --
-----------------------------------
function To_Unbounded_Wide_Wide_String
(Source : Wide_Wide_String) return Unbounded_Wide_Wide_String
is
Result : Unbounded_Wide_Wide_String;
begin
Result.Last := Source'Length;
Result.Reference := new Wide_Wide_String (1 .. Source'Length);
Result.Reference.all := Source;
return Result;
end To_Unbounded_Wide_Wide_String;
function To_Unbounded_Wide_Wide_String
(Length : Natural) return Unbounded_Wide_Wide_String
is
Result : Unbounded_Wide_Wide_String;
begin
Result.Last := Length;
Result.Reference := new Wide_Wide_String (1 .. Length);
return Result;
end To_Unbounded_Wide_Wide_String;
-------------------------
-- To_Wide_Wide_String --
-------------------------
function To_Wide_Wide_String
(Source : Unbounded_Wide_Wide_String) return Wide_Wide_String
is
begin
return Source.Reference (1 .. Source.Last);
end To_Wide_Wide_String;
---------------
-- Translate --
---------------
function Translate
(Source : Unbounded_Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping)
return Unbounded_Wide_Wide_String
is
begin
return
To_Unbounded_Wide_Wide_String
(Wide_Wide_Fixed.Translate
(Source.Reference (1 .. Source.Last), Mapping));
end Translate;
procedure Translate
(Source : in out Unbounded_Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping)
is
begin
Wide_Wide_Fixed.Translate (Source.Reference (1 .. Source.Last), Mapping);
end Translate;
function Translate
(Source : Unbounded_Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Unbounded_Wide_Wide_String
is
begin
return
To_Unbounded_Wide_Wide_String
(Wide_Wide_Fixed.Translate
(Source.Reference (1 .. Source.Last), Mapping));
end Translate;
procedure Translate
(Source : in out Unbounded_Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
is
begin
Wide_Wide_Fixed.Translate (Source.Reference (1 .. Source.Last), Mapping);
end Translate;
----------
-- Trim --
----------
function Trim
(Source : Unbounded_Wide_Wide_String;
Side : Trim_End) return Unbounded_Wide_Wide_String
is
begin
return
To_Unbounded_Wide_Wide_String
(Wide_Wide_Fixed.Trim (Source.Reference (1 .. Source.Last), Side));
end Trim;
procedure Trim
(Source : in out Unbounded_Wide_Wide_String;
Side : Trim_End)
is
Old : Wide_Wide_String_Access := Source.Reference;
begin
Source.Reference :=
new Wide_Wide_String'
(Wide_Wide_Fixed.Trim (Source.Reference (1 .. Source.Last), Side));
Source.Last := Source.Reference'Length;
Free (Old);
end Trim;
function Trim
(Source : Unbounded_Wide_Wide_String;
Left : Wide_Wide_Maps.Wide_Wide_Character_Set;
Right : Wide_Wide_Maps.Wide_Wide_Character_Set)
return Unbounded_Wide_Wide_String
is
begin
return
To_Unbounded_Wide_Wide_String
(Wide_Wide_Fixed.Trim
(Source.Reference (1 .. Source.Last), Left, Right));
end Trim;
procedure Trim
(Source : in out Unbounded_Wide_Wide_String;
Left : Wide_Wide_Maps.Wide_Wide_Character_Set;
Right : Wide_Wide_Maps.Wide_Wide_Character_Set)
is
Old : Wide_Wide_String_Access := Source.Reference;
begin
Source.Reference :=
new Wide_Wide_String'
(Wide_Wide_Fixed.Trim
(Source.Reference (1 .. Source.Last), Left, Right));
Source.Last := Source.Reference'Length;
Free (Old);
end Trim;
---------------------
-- Unbounded_Slice --
---------------------
function Unbounded_Slice
(Source : Unbounded_Wide_Wide_String;
Low : Positive;
High : Natural) return Unbounded_Wide_Wide_String
is
begin
if Low > Source.Last + 1 or else High > Source.Last then
raise Index_Error;
else
return
To_Unbounded_Wide_Wide_String (Source.Reference.all (Low .. High));
end if;
end Unbounded_Slice;
procedure Unbounded_Slice
(Source : Unbounded_Wide_Wide_String;
Target : out Unbounded_Wide_Wide_String;
Low : Positive;
High : Natural)
is
begin
if Low > Source.Last + 1 or else High > Source.Last then
raise Index_Error;
else
Target :=
To_Unbounded_Wide_Wide_String (Source.Reference.all (Low .. High));
end if;
end Unbounded_Slice;
end Ada.Strings.Wide_Wide_Unbounded;
|
--
-- Copyright 2018 The wookey project team <wookey@ssi.gouv.fr>
-- - Ryad Benadjila
-- - Arnauld Michelizza
-- - Mathieu Renard
-- - Philippe Thierry
-- - Philippe Trebuchet
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
--
package ewok.exported is
end ewok.exported;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010-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.
------------------------------------------------------------------------------
package AMF.Internals.Tables.OCL_Constructors is
function Create_OCL_Any_Type return AMF.Internals.AMF_Element;
function Create_OCL_Association_Class_Call_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Bag_Type return AMF.Internals.AMF_Element;
function Create_OCL_Boolean_Literal_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Collection_Item return AMF.Internals.AMF_Element;
function Create_OCL_Collection_Literal_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Collection_Range return AMF.Internals.AMF_Element;
function Create_OCL_Collection_Type return AMF.Internals.AMF_Element;
function Create_OCL_Enum_Literal_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Expression_In_Ocl return AMF.Internals.AMF_Element;
function Create_OCL_If_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Integer_Literal_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Invalid_Literal_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Invalid_Type return AMF.Internals.AMF_Element;
function Create_OCL_Iterate_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Iterator_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Let_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Message_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Message_Type return AMF.Internals.AMF_Element;
function Create_OCL_Null_Literal_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Operation_Call_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Ordered_Set_Type return AMF.Internals.AMF_Element;
function Create_OCL_Property_Call_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Real_Literal_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Sequence_Type return AMF.Internals.AMF_Element;
function Create_OCL_Set_Type return AMF.Internals.AMF_Element;
function Create_OCL_State_Exp return AMF.Internals.AMF_Element;
function Create_OCL_String_Literal_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Template_Parameter_Type return AMF.Internals.AMF_Element;
function Create_OCL_Tuple_Literal_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Tuple_Literal_Part return AMF.Internals.AMF_Element;
function Create_OCL_Tuple_Type return AMF.Internals.AMF_Element;
function Create_OCL_Type_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Unlimited_Natural_Literal_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Unspecified_Value_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Variable return AMF.Internals.AMF_Element;
function Create_OCL_Variable_Exp return AMF.Internals.AMF_Element;
function Create_OCL_Void_Type return AMF.Internals.AMF_Element;
end AMF.Internals.Tables.OCL_Constructors;
|
------------------------------------------------------------------------------
-- G E L A A S I S --
-- ASIS implementation for Gela project, a portable Ada compiler --
-- http://gela.ada-ru.org --
-- - - - - - - - - - - - - - - - --
-- Read copyright and license at the end of this file --
------------------------------------------------------------------------------
-- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $:
-- Purpose:
-- Procedural wrapper over Object-Oriented ASIS implementation
------------------------------------------------------------------------------
-- Implementation restriction --
-- not implemented Inconsistent list generation --
------------------------------------------------------------------------------
with Ada.Finalization;
with Ada.Unchecked_Deallocation;
with System;
with Asis.Errors; use Asis.Errors;
with Asis.Exceptions;
with Asis.Implementation;
with Asis.Elements;
with Asis.Ada_Environments;
with Asis.Clauses;
with Asis.Expressions;
with Asis.Iterator;
with Ada.Wide_Text_IO;
package body Asis.Compilation_Units.Relations is
package Utils is
-- Compilation_Unit_List_Access --
type Compilation_Unit_List_Access is
access all Compilation_Unit_List;
procedure Deallocate is
new Ada.Unchecked_Deallocation
(Compilation_Unit_List, Compilation_Unit_List_Access);
function In_List
(List : in Compilation_Unit_List_Access;
Last : in ASIS_Integer;
Unit : in Compilation_Unit)
return Boolean;
function Append
(List : in Compilation_Unit_List_Access;
Unit : in Compilation_Unit)
return Compilation_Unit_List_Access;
function Append
(List : in Compilation_Unit_List_Access;
Units : in Compilation_Unit_List)
return Compilation_Unit_List_Access;
procedure Remove_From_List
(List : in out Compilation_Unit_List_Access;
Unit : in Compilation_Unit);
procedure Remove_From_List
(List : in out Compilation_Unit_List;
From : in List_Index;
Unit : in Compilation_Unit);
-- Tree --
type Root_Tree is
new Ada.Finalization.Limited_Controlled with private;
type Root_Tree_Access is access all Root_Tree;
type Tree_Node is
new Ada.Finalization.Limited_Controlled with private;
type Tree_Node_Access is access all Tree_Node;
-- Tree_Node_Array --
type Tree_Node_Array is array (Positive range <>) of Tree_Node_Access;
type Tree_Node_Array_Access is access all Tree_Node_Array;
procedure Deallocate is
new Ada.Unchecked_Deallocation
(Tree_Node_Array, Tree_Node_Array_Access);
function Append
(List : in Tree_Node_Array_Access;
Node : in Tree_Node_Access)
return Tree_Node_Array_Access;
function In_List
(List : in Tree_Node_Array_Access;
Last : in Natural;
Node : in Tree_Node_Access)
return Boolean;
-- Root_Tree --
type Orders is (Ascending, Descending);
procedure Dependence_Order
(This : in Root_Tree_Access;
Order : in Orders);
function Add_Child
(This : in Root_Tree_Access;
Node : in Tree_Node_Access;
Unit : in Compilation_Unit)
return Tree_Node_Access;
function Add_Child
(This : in Root_Tree_Access;
Node : in Tree_Node_Access;
Spec_Unit : in Compilation_Unit;
Body_Unit : in Compilation_Unit;
Skip_Spec : in Boolean := False)
return Tree_Node_Access;
function Add_Subunit
(This : in Root_Tree_Access;
Node : in Tree_Node_Access;
Unit : in Compilation_Unit)
return Tree_Node_Access;
procedure Append
(This : in Root_Tree_Access;
Unit : in Compilation_Unit);
procedure Glue_Nodes
(This : in Root_Tree_Access;
Node : in Tree_Node_Access;
To_Node : in Tree_Node_Access);
procedure Glue_Nodes_Checked
(This : in Root_Tree_Access;
Node : in Tree_Node_Access;
To_Node : in Tree_Node_Access);
procedure Set_Parent
(This : in Root_Tree_Access;
Node : in Tree_Node_Access;
Parent : in Tree_Node_Access);
procedure Clear
(This : in out Root_Tree);
procedure Add_Body_Dependents
(This : in Root_Tree_Access;
Node : in Tree_Node_Access;
To_Node : in Tree_Node_Access);
function Find
(This : in Root_Tree_Access;
Unit : in Compilation_Unit)
return Tree_Node_Access;
procedure Check
(This : in Root_Tree_Access;
The_Context : in Asis.Context);
function Generate_Relationship
(This : in Root_Tree_Access;
Limit_List : in Utils.Compilation_Unit_List_Access;
List_Last : in ASIS_Integer)
return Relationship;
function Create_Elaboration_Tree
(This : in Root_Tree_Access;
The_Context : in Asis.Context)
return Root_Tree_Access;
function Is_Child
(This : in Root_Tree_Access;
Node : in Tree_Node_Access)
return Boolean;
function Is_Have_Circular_Dependences
(This : in Root_Tree_Access)
return Boolean;
-- Tree_Node --
function Is_Skip_Spec
(This : in Tree_Node_Access)
return Boolean;
procedure Skip_Spec
(This : in Tree_Node_Access;
Value : in Boolean);
function Nexts
(This : in Tree_Node_Access)
return Tree_Node_Array_Access;
function Get_Spec
(This : in Tree_Node_Access)
return Compilation_Unit;
function Get_Body
(This : in Tree_Node_Access)
return Compilation_Unit;
Use_Error : exception;
private
-- Tree_Node --
type Extended_Boolean is (Unknown, Extended_True, Extended_False);
type Tree_Node is
new Ada.Finalization.Limited_Controlled with record
Self : Tree_Node_Access := Tree_Node'Unchecked_Access;
-- ссылка на предыдущие елементы
Prevs : Tree_Node_Array_Access := null;
-- последующие елементы
Next : Tree_Node_Array_Access := null;
-- модуль_компиляции
Unit : Compilation_Unit := Nil_Compilation_Unit;
Unit_Body : Compilation_Unit := Nil_Compilation_Unit;
Skip_Spec : Boolean := False;
Added : Boolean := False;
Consistent : Boolean := True;
Body_Consistent : Boolean := True;
-- зависимости тела (with)
Body_Dependences : Tree_Node_Array_Access := null;
-- список циклических зависимостей
Circular : Compilation_Unit_List_Access := null;
Circular_Added : Boolean := False;
-- список пропавших юнитов
Missing : Compilation_Unit_List_Access := null;
Missing_Added : Boolean := False;
-- список несоглассованных юнитов
Inconsistent : Compilation_Unit_List_Access := null;
Inconsistent_Added : Boolean := False;
Elaborated : Boolean := False;
Body_Elaborated : Boolean := False;
Internal_Pure : Extended_Boolean := Unknown;
Internal_Preelaborate : Extended_Boolean := Unknown;
Internal_Spec_With_Body : Extended_Boolean := Unknown;
end record;
procedure Finalize
(This : in out Tree_Node);
function Is_Pure
(This : in Tree_Node_Access)
return Boolean;
function Is_Preelaborate
(This : in Tree_Node_Access)
return Boolean;
function Is_Elaborate_Body
(This : in Tree_Node_Access)
return Boolean;
procedure Retrive_Pragmas
(This : in Tree_Node_Access);
-- Root_Tree --
type Unit_Node is record
Unit : Compilation_Unit;
Node : Tree_Node_Access;
end record;
type Unit_Node_Array is array (Positive range <>) of Unit_Node;
type Unit_Node_Array_Access is access all Unit_Node_Array;
type Root_Tree is
new Ada.Finalization.Limited_Controlled with record
Self : Root_Tree_Access := Root_Tree'Unchecked_Access;
Order : Orders := Descending;
Next : Tree_Node_Array_Access := null;
-- сортированный список всех
-- елементов для быстрого
-- определения наличия елемента
-- в списке
Units : Unit_Node_Array_Access := null;
Last_Node : Tree_Node_Access := null;
end record;
procedure Finalize
(This : in out Root_Tree);
-- Additional --
procedure Deallocate is
new Ada.Unchecked_Deallocation
(Tree_Node, Tree_Node_Access);
procedure Deallocate is
new Ada.Unchecked_Deallocation
(Unit_Node_Array, Unit_Node_Array_Access);
type Positive_Access is access all Positive;
function Add_Node
(List : in Tree_Node_Array_Access;
Node : in Tree_Node_Access)
return Tree_Node_Array_Access;
procedure Remove
(List : in out Tree_Node_Array_Access;
Node : in Tree_Node_Access);
function Remove
(List : in Tree_Node_Array_Access;
Node : in Tree_Node_Access)
return Tree_Node_Array_Access;
function Add_Node_Ordered
(List : in Unit_Node_Array_Access;
Node : in Tree_Node_Access)
return Unit_Node_Array_Access;
function Find
(List : in Unit_Node_Array_Access;
Unit : in Compilation_Unit;
From : in Positive;
To : in Positive;
Index : in Positive_Access)
return Boolean;
function Compare
(Left : in Compilation_Unit;
Right : in Compilation_Unit)
return Integer;
function Is_Inconsistent
(Unit : in Compilation_Unit)
return Boolean;
function Is_Source_Changed
(Unit : in Compilation_Unit)
return Boolean;
end Utils;
procedure Deallocate is
new Ada.Unchecked_Deallocation
(Utils.Root_Tree, Utils.Root_Tree_Access);
procedure Check_Compilation_Unit
(Unit : in Compilation_Unit;
The_Context : in Asis.Context;
Message : in Wide_String);
procedure Normalize
(List : in Asis.Compilation_Unit_List;
Result : in Utils.Compilation_Unit_List_Access;
Last : out ASIS_Integer);
function Get_Ancestors
(List : in Asis.Compilation_Unit_List;
The_Context : in Asis.Context)
return Utils.Root_Tree_Access;
function Get_Descendants
(List : in Asis.Compilation_Unit_List;
The_Context : in Asis.Context)
return Utils.Root_Tree_Access;
function Get_Supporters
(List : in Asis.Compilation_Unit_List;
The_Context : in Asis.Context)
return Utils.Root_Tree_Access;
function Get_Dependents
(List : in Asis.Compilation_Unit_List;
The_Context : in Asis.Context)
return Utils.Root_Tree_Access;
function Get_Family
(List : in Asis.Compilation_Unit_List;
The_Context : in Asis.Context)
return Utils.Root_Tree_Access;
function Get_Needed_Units
(List : in Asis.Compilation_Unit_List;
The_Context : in Asis.Context)
return Utils.Root_Tree_Access;
procedure Get_Subunits
(Tree : in Utils.Root_Tree_Access;
Unit : in Compilation_Unit;
Node : in Utils.Tree_Node_Access;
The_Context : in Asis.Context);
function Get_Compilation_Unit
(Unit : in Compilation_Unit;
Target : in Asis.Element;
Number : in List_Index;
The_Context : in Asis.Context)
return Asis.Compilation_Unit;
function Have_With
(Library : in Compilation_Unit;
Unit : in Compilation_Unit;
The_Context : in Asis.Context)
return Boolean;
type Check_10_1_1_26c_26b_Information is record
Exceptions : Boolean := False;
System : Boolean := False;
end record;
function Check_10_1_1_26c_26b
(Unit : in Compilation_Unit;
The_Context : in Asis.Context)
return Check_10_1_1_26c_26b_Information;
----------------------------
-- Check_Compilation_Unit --
----------------------------
procedure Check_Compilation_Unit
(Unit : in Compilation_Unit;
The_Context : in Asis.Context;
Message : in Wide_String)
is
Kind : Asis.Unit_Kinds;
begin
Kind := Unit_Kind (Unit);
if Kind = Not_A_Unit
or else Kind = A_Nonexistent_Declaration
or else Kind = A_Nonexistent_Body
or else Kind = A_Configuration_Compilation
then
Asis.Implementation.Set_Status
(Data_Error, Message & " invalid unit " & Unit_Full_Name (Unit));
raise Asis.Exceptions.ASIS_Inappropriate_Compilation_Unit;
end if;
if not Asis.Ada_Environments.Is_Equal
(Enclosing_Context (Unit), The_Context)
then
Asis.Implementation.Set_Status
(Data_Error, Message & " invalid unit's context "
& Unit_Full_Name (Unit));
raise Asis.Exceptions.ASIS_Inappropriate_Compilation_Unit;
end if;
end Check_Compilation_Unit;
---------------
-- Normalize --
---------------
procedure Normalize
(List : in Asis.Compilation_Unit_List;
Result : in Utils.Compilation_Unit_List_Access;
Last : out ASIS_Integer)
is
Unit : Compilation_Unit;
begin
Last := 0;
for Index in List'Range loop
Unit := List (Index);
if not Is_Nil (Unit)
and then Unit_Kind (Unit) /= An_Unknown_Unit
then
if not Utils.In_List (Result, Last, Unit) then
Last := Last + 1;
Result (Last) := List (Index);
end if;
end if;
end loop;
end Normalize;
-------------------------
-- Elaboration_Order --
-------------------------
function Elaboration_Order
(Compilation_Units : in Asis.Compilation_Unit_List;
The_Context : in Asis.Context)
return Relationship
is
procedure Clear;
Tree : Utils.Root_Tree_Access := null;
Elaborate_Tree : Utils.Root_Tree_Access := null;
Compilation_Units_Last : ASIS_Integer := 0;
Normalized_Compilation_Units :
Utils.Compilation_Unit_List_Access := null;
-- Clear --
procedure Clear is
begin
Deallocate (Tree);
Deallocate (Elaborate_Tree);
Utils.Deallocate (Normalized_Compilation_Units);
end Clear;
begin
if Compilation_Units = Nil_Compilation_Unit_List then
return Nil_Relationship;
end if;
for Index in Compilation_Units'Range loop
Check_Compilation_Unit
(Compilation_Units (Index), The_Context,
"Elaboration_Order:Compilation_Unit");
end loop;
Normalized_Compilation_Units := new
Asis.Compilation_Unit_List (1 .. Compilation_Units'Length);
Normalized_Compilation_Units.all := (others => Nil_Compilation_Unit);
Normalize (Compilation_Units,
Normalized_Compilation_Units,
Compilation_Units_Last);
Tree := Get_Needed_Units
(Normalized_Compilation_Units (1 .. Compilation_Units_Last),
The_Context);
Utils.Check (Tree, The_Context);
if Utils.Is_Have_Circular_Dependences (Tree) then
Clear;
Asis.Implementation.Set_Status
(Data_Error, "Elaboration_Order - "
& "Circular semantic dependence detected, can not create "
& "elaboration order");
raise Asis.Exceptions.ASIS_Failed;
end if;
Elaborate_Tree := Utils.Create_Elaboration_Tree (Tree, The_Context);
declare
Relation : Relationship := Utils.Generate_Relationship
(Elaborate_Tree, null, 0);
begin
Clear;
return Relation;
end;
exception
when others =>
Clear;
raise;
end Elaboration_Order;
---------------------------------
-- Semantic_Dependence_Order --
---------------------------------
function Semantic_Dependence_Order
(Compilation_Units : in Asis.Compilation_Unit_List;
Dependent_Units : in Asis.Compilation_Unit_List;
The_Context : in Asis.Context;
Relation : in Asis.Relation_Kinds)
return Relationship
is
procedure Clear;
Compilation_Units_Last : ASIS_Integer := 0;
Normalized_Compilation_Units :
Utils.Compilation_Unit_List_Access := null;
Dependent_Units_Last : ASIS_Integer := 0;
Normalized_Dependent_Units :
Utils.Compilation_Unit_List_Access := null;
Tree : Utils.Root_Tree_Access := null;
procedure Clear is begin
Deallocate (Tree);
Utils.Deallocate (Normalized_Compilation_Units);
Utils.Deallocate (Normalized_Dependent_Units);
end Clear;
begin
if Compilation_Units = Nil_Compilation_Unit_List then
return Nil_Relationship;
end if;
for Index in Compilation_Units'Range loop
Check_Compilation_Unit
(Compilation_Units (Index), The_Context,
"Semantic_Dependence_Order:Compilation_Unit");
end loop;
Normalized_Compilation_Units := new
Asis.Compilation_Unit_List (1 .. Compilation_Units'Length);
Normalized_Compilation_Units.all := (others => Nil_Compilation_Unit);
Normalize (Compilation_Units,
Normalized_Compilation_Units,
Compilation_Units_Last);
-- Dependent_Units are ignored unless the Relation
-- is Descendants or Dependents
if (Relation = Descendants or else Relation = Dependents)
and then Dependent_Units /= Nil_Compilation_Unit_List
then
for Index in Dependent_Units'Range loop
Check_Compilation_Unit
(Dependent_Units (Index), The_Context,
"Semantic_Dependence_Order:Dependent_Unit");
end loop;
Normalized_Dependent_Units := new
Asis.Compilation_Unit_List (1 .. Dependent_Units'Length);
Normalized_Dependent_Units.all := (others => Nil_Compilation_Unit);
Normalize (Dependent_Units,
Normalized_Dependent_Units,
Dependent_Units_Last);
end if;
case Relation is
when Ancestors =>
Tree := Get_Ancestors
(Normalized_Compilation_Units (1 .. Compilation_Units_Last),
The_Context);
when Descendants =>
Tree := Get_Descendants
(Normalized_Compilation_Units
(1 .. Compilation_Units_Last), The_Context);
when Supporters =>
Tree := Get_Supporters
(Normalized_Compilation_Units (1 .. Compilation_Units_Last),
The_Context);
when Dependents =>
Tree := Get_Dependents
(Normalized_Compilation_Units (1 .. Compilation_Units_Last),
The_Context);
when Family =>
Tree := Get_Family
(Normalized_Compilation_Units (1 .. Compilation_Units_Last),
The_Context);
when Needed_Units =>
Tree := Get_Needed_Units
(Normalized_Compilation_Units (1 .. Compilation_Units_Last),
The_Context);
end case;
Utils.Check (Tree, The_Context);
declare
Relation : Relationship := Utils.Generate_Relationship
(Tree, Normalized_Dependent_Units, Dependent_Units_Last);
begin
Clear;
return Relation;
end;
exception
when others =>
Clear;
raise;
end Semantic_Dependence_Order;
-------------------
-- Get_Ancestors --
-------------------
function Get_Ancestors
(List : in Asis.Compilation_Unit_List;
The_Context : in Asis.Context)
return Utils.Root_Tree_Access
is
use Utils;
Unit : Compilation_Unit;
Kinds : Unit_Kinds;
Result : Root_Tree_Access := new Root_Tree;
procedure Append_Node
(Unit : in Compilation_Unit;
Node : in out Tree_Node_Access);
procedure Retrive
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access);
-- Append_Node --
procedure Append_Node
(Unit : in Compilation_Unit;
Node : in out Tree_Node_Access)
is
Exist_Node : Tree_Node_Access;
begin
Exist_Node := Find (Result, Unit);
if Exist_Node /= null then
Glue_Nodes (Result, Node, Exist_Node);
Node := null;
else
Node := Add_Child (Result, Node, Unit);
end if;
end Append_Node;
-- Retrive --
procedure Retrive
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access)
is
Internal_Node : Tree_Node_Access := Node;
Internal_Unit : Compilation_Unit := Unit;
begin
while Unit_Kind (Internal_Unit) in
A_Procedure .. A_Generic_Package_Renaming
loop
Append_Node (Internal_Unit, Internal_Node);
if Internal_Node = null then
return;
end if;
Internal_Unit := Corresponding_Parent_Declaration (Internal_Unit);
end loop;
if not Is_Nil (Internal_Unit) then
Append_Node (Internal_Unit, Internal_Node);
if Internal_Node = null then
return;
end if;
-- add Standart as root
Append_Node
(Library_Unit_Declaration ("Standard", The_Context),
Internal_Node);
end if;
end Retrive;
begin
Dependence_Order (Result, Ascending);
for Index in List'Range loop
Unit := List (Index);
if Find (Result, Unit) = null then
Kinds := Unit_Kind (Unit);
if Kinds in A_Subunit then
Asis.Implementation.Set_Status
(Data_Error, "Subunit not valid for Ancestors request "
& Unit_Full_Name (Unit));
raise Asis.Exceptions.ASIS_Inappropriate_Compilation_Unit;
elsif Kinds in A_Library_Unit_Body then
Unit := Corresponding_Parent_Declaration (Unit, The_Context);
end if;
Retrive (Unit, null);
end if;
end loop;
return Result;
exception
when others =>
Deallocate (Result);
raise;
end Get_Ancestors;
---------------------
-- Get_Descendants --
---------------------
function Get_Descendants
(List : in Asis.Compilation_Unit_List;
The_Context : in Asis.Context)
return Utils.Root_Tree_Access
is
use Utils;
Result : Root_Tree_Access := new Root_Tree;
Unit : Compilation_Unit;
Second_Unit : Compilation_Unit;
Kinds : Unit_Kinds;
procedure Retrive
(Target : in Compilation_Unit;
Node : in Utils.Tree_Node_Access);
-- Retrive --
procedure Retrive
(Target : in Compilation_Unit;
Node : in Utils.Tree_Node_Access)
is
function Process
(Index : in List_Index)
return Boolean;
Exist_Node : Utils.Tree_Node_Access := null;
Children_List : Asis.Compilation_Unit_List :=
Corresponding_Children (Target, The_Context);
-- Process --
function Process
(Index : in List_Index)
return Boolean
is
begin
Kinds := Unit_Kind (Unit);
Exist_Node := Find (Result, Unit);
Second_Unit := Nil_Compilation_Unit;
if Exist_Node /= null then
Glue_Nodes (Result, Node, Exist_Node);
if Kinds in A_Procedure .. A_Generic_Package then
Second_Unit := Corresponding_Body (Unit, The_Context);
elsif Kinds in A_Library_Unit_Body then
Second_Unit := Corresponding_Declaration (Unit, The_Context);
end if;
if not Is_Nil (Second_Unit)
and then not Is_Identical (Second_Unit, Unit)
then
Remove_From_List (Children_List, Index + 1, Second_Unit);
end if;
return False;
end if;
if Kinds in
A_Procedure_Instance .. A_Generic_Package_Renaming
then
Exist_Node := Add_Child (Result, Node, Unit);
elsif Kinds in A_Procedure .. A_Generic_Package then
Second_Unit := Corresponding_Body (Unit, The_Context);
if not Is_Nil (Second_Unit)
and then not Is_Identical (Second_Unit, Unit)
then
Exist_Node := Add_Child (Result, Node, Unit, Second_Unit);
Remove_From_List (Children_List, Index + 1, Second_Unit);
else
Exist_Node := Add_Child (Result, Node, Unit);
end if;
elsif Kinds in A_Library_Unit_Body then
Second_Unit := Corresponding_Declaration (Unit, The_Context);
if not Is_Nil (Second_Unit)
and then not Is_Identical (Second_Unit, Unit)
then
Exist_Node := Add_Child (Result, Node, Second_Unit, Unit);
Remove_From_List (Children_List, Index + 1, Second_Unit);
Unit := Second_Unit;
else
Exist_Node := Add_Child (Result, Node, Unit);
end if;
else
Exist_Node := Add_Child (Result, Node, Unit);
end if;
return True;
end Process;
begin
for Index in Children_List'Range loop
Unit := Children_List (Index);
if not Is_Nil (Unit) then
if Process (Index) then
Kinds := Unit_Kind (Unit);
if Kinds = A_Package
or else Kinds = A_Generic_Package
or else Kinds = A_Package_Instance
then
Retrive (Unit, Exist_Node);
end if;
end if;
end if;
end loop;
end Retrive;
Declarations_List :
Utils.Compilation_Unit_List_Access := null;
Declarations_Last : ASIS_Integer := 0;
begin
Dependence_Order (Result, Descending);
Declarations_List := new Asis.Compilation_Unit_List (1 .. List'Length);
for Index in List'Range loop
Unit := List (Index);
Kinds := Unit_Kind (Unit);
if Kinds in A_Subunit then
Asis.Implementation.Set_Status
(Data_Error, "Subunit not valid for Descendants request "
& Unit_Full_Name (Unit));
end if;
if Kinds in A_Library_Unit_Body then
Unit := Corresponding_Declaration (Unit);
Kinds := Unit_Kind (Unit);
end if;
if Kinds = A_Package
or else Kinds = A_Generic_Package
or else Kinds = A_Package_Instance
then
if not In_List (Declarations_List, Declarations_Last, Unit) then
Declarations_Last := Declarations_Last + 1;
Declarations_List (Declarations_Last) := Unit;
end if;
end if;
end loop;
for Index in 1 .. Declarations_Last loop
Unit := Declarations_List (Index);
if Find (Result, Unit) = null then
Second_Unit := Corresponding_Body (Unit, The_Context);
if not Is_Nil (Second_Unit)
and then not Is_Identical (Second_Unit, Unit)
then
Retrive (Unit, Add_Child (Result, null, Unit, Second_Unit));
else
Retrive (Unit, Add_Child (Result, null, Unit));
end if;
end if;
end loop;
Deallocate (Declarations_List);
return Result;
exception
when others =>
Deallocate (Declarations_List);
Deallocate (Result);
raise;
end Get_Descendants;
--------------------
-- Get_Supporters --
--------------------
function Get_Supporters
(List : in Asis.Compilation_Unit_List;
The_Context : in Asis.Context)
return Utils.Root_Tree_Access
is
use Utils;
Unit : Compilation_Unit;
Kinds : Unit_Kinds;
Result : Root_Tree_Access := new Root_Tree;
Node : Tree_Node_Access := null;
Std : Compilation_Unit :=
Library_Unit_Declaration ("Standard", The_Context);
procedure Append_Unit
(Unit : in Compilation_Unit;
Node : in out Tree_Node_Access);
procedure Retrive
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
First_Node : in Boolean := False);
procedure Retrive_Declarations
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
First_Node : in Boolean);
procedure Retrive_Body
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
First_Node : in Boolean);
procedure Retrive_Subunit
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access);
procedure Retrive_With_Clause
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
For_Body : in Boolean := False);
procedure Check_10_1_1_26c_26b
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
For_Body : in Boolean := False);
-- Append_Unit --
procedure Append_Unit
(Unit : in Compilation_Unit;
Node : in out Tree_Node_Access)
is
Exist_Node : Tree_Node_Access;
begin
Exist_Node := Find (Result, Unit);
if Exist_Node = null then
Node := Add_Child (Result, Node, Unit);
else
if Node /= null then
Glue_Nodes_Checked (Result, Node, Exist_Node);
Node := null;
end if;
end if;
end Append_Unit;
-- Retrive --
procedure Retrive
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
First_Node : in Boolean := False)
is
Internal_Node : Tree_Node_Access := Node;
begin
if Is_Nil (Unit) then
return;
end if;
Kinds := Unit_Kind (Unit);
if Kinds in A_Nonexistent_Declaration .. An_Unknown_Unit then
Append_Unit (Std, Internal_Node);
elsif Kinds in A_Subunit then
Retrive_Subunit (Unit, Node);
elsif Kinds in A_Procedure_Body .. A_Package_Body then
Retrive_Body (Unit, Node, First_Node);
else
Retrive_Declarations (Unit, Node, First_Node);
end if;
end Retrive;
-- Retrive_Declarations --
procedure Retrive_Declarations
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
First_Node : in Boolean)
is
Parent : Compilation_Unit;
Internal_Node : Tree_Node_Access := Node;
begin
if not First_Node then
Append_Unit (Unit, Internal_Node);
if Internal_Node = null then
return;
end if;
end if;
if Is_Identical (Unit, Std) then
return;
end if;
Check_10_1_1_26c_26b (Unit, Internal_Node);
Retrive_With_Clause (Unit, Internal_Node);
Parent := Corresponding_Parent_Declaration (Unit, The_Context);
while Unit_Kind (Parent) in
A_Procedure .. A_Generic_Package_Renaming
loop
Append_Unit (Parent, Internal_Node);
if Internal_Node = null
or else Is_Identical (Unit, Std)
then
return;
end if;
Check_10_1_1_26c_26b (Parent, Internal_Node);
Retrive_With_Clause (Parent, Internal_Node);
Parent := Corresponding_Parent_Declaration (Parent, The_Context);
end loop;
Retrive (Parent, Internal_Node);
end Retrive_Declarations;
-- Retrive_Body --
procedure Retrive_Body
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
First_Node : in Boolean)
is
Internal_Node : Tree_Node_Access := Node;
begin
if not First_Node then
Append_Unit (Unit, Internal_Node);
if Internal_Node = null then
return;
end if;
end if;
Check_10_1_1_26c_26b (Unit, Internal_Node, True);
Retrive_With_Clause (Unit, Internal_Node, True);
Retrive
(Corresponding_Parent_Declaration (Unit, The_Context),
Internal_Node);
end Retrive_Body;
-- Retrive_Subunit --
procedure Retrive_Subunit
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access)
is
Parent : Compilation_Unit;
vNode : Tree_Node_Access := Node;
begin
Check_10_1_1_26c_26b (Unit, null, True);
Retrive_With_Clause (Unit, null, True);
Parent := Corresponding_Subunit_Parent_Body (Unit);
while Unit_Kind (Parent) in A_Subunit loop
Append_Unit (Unit, vNode);
if vNode = null then
return;
end if;
Check_10_1_1_26c_26b (Parent, vNode, True);
Retrive_With_Clause (Parent, vNode, True);
Parent := Corresponding_Subunit_Parent_Body (Parent);
end loop;
Retrive (Parent, vNode);
end Retrive_Subunit;
-- Retrive_With_Clause --
procedure Retrive_With_Clause
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
For_Body : in Boolean := False)
is
With_List : constant Asis.Context_Clause_List :=
Asis.Elements.Context_Clause_Elements (Unit);
Internal_Unit : Compilation_Unit;
Exist_Node : Tree_Node_Access;
begin
for Index in With_List'Range loop
if Clause_Kind (With_List (Index).all) = A_With_Clause then
Internal_Unit := Get_Compilation_Unit
(Unit, With_List (Index), Index, The_Context);
if not Is_Nil (Internal_Unit) then
if not For_Body then
Retrive (Internal_Unit, Node);
else
Exist_Node := Find (Result, Internal_Unit);
if Exist_Node = null then
Exist_Node := Add_Child (Result, null, Internal_Unit);
if Node /= null then
Add_Body_Dependents (Result, Exist_Node, Node);
end if;
Retrive (Internal_Unit, Exist_Node, True);
else
if Node /= null then
Add_Body_Dependents (Result, Exist_Node, Node);
end if;
end if;
end if;
end if;
end if;
end loop;
end Retrive_With_Clause;
-- Check_10_1_1_26c_26b --
procedure Check_10_1_1_26c_26b
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
For_Body : in Boolean := False)
is
procedure Retrive_For_Body
(Unit : in Compilation_Unit);
Except : Compilation_Unit := Library_Unit_Declaration
("Ada.Exceptions", The_Context);
Sys : Compilation_Unit := Library_Unit_Declaration
("System", The_Context);
State : Check_10_1_1_26c_26b_Information;
-- Retrive_For_Body --
procedure Retrive_For_Body
(Unit : in Compilation_Unit)
is
Exist_Node : Tree_Node_Access;
begin
Exist_Node := Find (Result, Unit);
if Exist_Node = null then
Exist_Node := Add_Child (Result, null, Unit);
if Node /= null then
Add_Body_Dependents (Result, Exist_Node, Node);
end if;
Retrive (Unit, Exist_Node, True);
else
if Node /= null then
Add_Body_Dependents (Result, Exist_Node, Node);
end if;
end if;
end Retrive_For_Body;
begin
State := Check_10_1_1_26c_26b (Unit, The_Context);
if State.Exceptions then
if not For_Body then
Retrive (Except, Node);
else
Retrive_For_Body (Except);
end if;
end if;
if State.System then
if not For_Body then
Retrive (Sys, Node);
else
Retrive_For_Body (Sys);
end if;
end if;
end Check_10_1_1_26c_26b;
begin
Dependence_Order (Result, Ascending);
for Index in List'Range loop
Unit := List (Index);
if Find (Result, Unit) = null then
Retrive (Unit, null, True);
end if;
end loop;
return Result;
exception
when others =>
Deallocate (Result);
raise;
end Get_Supporters;
--------------------
-- Get_Dependents --
--------------------
function Get_Dependents
(List : in Asis.Compilation_Unit_List;
The_Context : in Asis.Context)
return Utils.Root_Tree_Access
is
use Utils;
procedure Append_To_Node
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
Glued : in out Tree_Node_Array_Access);
procedure Post_Operation
(Element : in Asis.Element;
Control : in out Traverse_Control;
State : in out Boolean);
function Have_Except
(Unit : in Compilation_Unit)
return Boolean;
function Have_Sys
(Unit : in Compilation_Unit)
return Boolean;
procedure Retrive
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access);
Result : Root_Tree_Access := new Root_Tree;
Unit, Body_Unit : Compilation_Unit;
Kinds : Unit_Kinds;
Except : Compilation_Unit := Library_Unit_Declaration
("Ada.Exceptions", The_Context);
Sys : Compilation_Unit := Library_Unit_Declaration
("System", The_Context);
procedure Append_To_Node
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
Glued : in out Tree_Node_Array_Access)
is
Exist_Node : Tree_Node_Access := null;
Second_Unit : Compilation_Unit;
begin
Exist_Node := Find (Result, Unit);
Kinds := Unit_Kind (Unit);
if Kinds in A_Procedure .. A_Generic_Package then
if Exist_Node /= null then
if Is_Child (Result, Exist_Node) then
Set_Parent (Result, Exist_Node, Node);
else
Glue_Nodes_Checked (Result, Node, Exist_Node);
end if;
if not Is_Skip_Spec (Exist_Node) then
Glued := Append (Glued, Exist_Node);
else
Skip_Spec (Exist_Node, False);
end if;
else
Second_Unit := Corresponding_Body (Unit, The_Context);
Exist_Node := Add_Child (Result, Node, Unit, Second_Unit);
end if;
elsif Kinds in A_Library_Unit_Body then
if Exist_Node /= null then
Add_Body_Dependents (Result, Exist_Node, Node);
else
Second_Unit := Corresponding_Declaration (Unit, The_Context);
if not Is_Nil (Second_Unit)
and then not Is_Identical (Second_Unit, Unit)
then
Exist_Node := Find (Result, Second_Unit);
if Exist_Node /= null then
Add_Body_Dependents (Result, Exist_Node, Node);
else
Exist_Node := Add_Child
(Result, null, Second_Unit, Unit, True);
Add_Body_Dependents (Result, Exist_Node, Node);
end if;
else
Exist_Node := Add_Child (Result, null, Unit);
Add_Body_Dependents (Result, Exist_Node, Node);
end if;
end if;
elsif Kinds in A_Subunit then
if Exist_Node /= null then
Add_Body_Dependents (Result, Exist_Node, Node);
else
Exist_Node := Add_Child (Result, null, Unit);
Add_Body_Dependents (Result, Exist_Node, Node);
end if;
else
if Exist_Node /= null then
Glue_Nodes_Checked (Result, Node, Exist_Node);
if not Is_Skip_Spec (Exist_Node) then
Glued := Append (Glued, Exist_Node);
else
Skip_Spec (Exist_Node, False);
end if;
else
Exist_Node := Add_Child (Result, Node, Unit);
end if;
end if;
end Append_To_Node;
procedure Post_Operation
(Element : in Asis.Element;
Control : in out Traverse_Control;
State : in out Boolean)
is
begin
null;
end Post_Operation;
-- Have_Except --
function Have_Except
(Unit : in Compilation_Unit)
return Boolean
is
procedure Pre_Operation
(Element : in Asis.Element;
Control : in out Traverse_Control;
State : in out Boolean);
Control : Traverse_Control := Continue;
State : Boolean := False;
procedure Pre_Operation
(Element : in Asis.Element;
Control : in out Traverse_Control;
State : in out Boolean)
is
use Asis.Elements;
begin
if Declaration_Kind (Element) =
A_Choice_Parameter_Specification
then
State := True;
Control := Terminate_Immediately;
end if;
end Pre_Operation;
procedure Check_Choice_Iterator is new
Asis.Iterator.Traverse_Element
(Boolean, Pre_Operation, Post_Operation);
begin
Check_Choice_Iterator
(Asis.Elements.Unit_Declaration (Unit), Control, State);
return State;
end Have_Except;
-- Have_Sys --
function Have_Sys
(Unit : in Compilation_Unit)
return Boolean
is
procedure Pre_Operation
(Element : in Asis.Element;
Control : in out Traverse_Control;
State : in out Boolean);
Control : Traverse_Control := Continue;
State : Boolean := False;
procedure Pre_Operation
(Element : in Asis.Element;
Control : in out Traverse_Control;
State : in out Boolean)
is
use Asis.Elements;
begin
if Expression_Kind (Element) = An_Attribute_Reference
and then Attribute_Kind (Element) = An_Address_Attribute
then
State := True;
Control := Terminate_Immediately;
end if;
end Pre_Operation;
procedure Check_Choice_Iterator is new
Asis.Iterator.Traverse_Element
(Boolean, Pre_Operation, Post_Operation);
begin
Check_Choice_Iterator
(Asis.Elements.Unit_Declaration (Unit), Control, State);
return State;
end Have_Sys;
-- Retrive --
procedure Retrive
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access)
is
use Utils;
Exist_Node : Tree_Node_Access := null;
Glued : Tree_Node_Array_Access := null;
begin
if Is_Nil (Unit) then
return;
end if;
-- subunits --
if not Is_Nil (Get_Body (Node)) then
Get_Subunits (Result, Get_Body (Node), Node, The_Context);
end if;
-- childrens --
declare
Children_List : Asis.Compilation_Unit_List :=
Corresponding_Children (Unit, The_Context);
Children : Compilation_Unit;
Second_Unit : Compilation_Unit;
begin
for Index in Children_List'Range loop
Children := Children_List (Index);
if not Is_Nil (Children) then
Second_Unit := Nil_Compilation_Unit;
Kinds := Unit_Kind (Children);
Exist_Node := Find (Result, Children);
if Exist_Node /= null then
if Is_Child (Result, Exist_Node) then
Set_Parent (Result, Exist_Node, Node);
else
Glue_Nodes_Checked (Result, Node, Exist_Node);
end if;
if not Is_Skip_Spec (Exist_Node) then
Glued := Append (Glued, Exist_Node);
else
Skip_Spec (Exist_Node, False);
end if;
if Kinds in A_Procedure .. A_Generic_Package then
Second_Unit := Corresponding_Body
(Children, The_Context);
elsif Kinds in A_Library_Unit_Body then
Second_Unit := Corresponding_Declaration
(Children, The_Context);
end if;
if not Is_Nil (Second_Unit)
and then not Is_Identical (Second_Unit, Children)
then
Remove_From_List
(Children_List, Index + 1, Second_Unit);
end if;
else
if Kinds in
A_Procedure_Instance .. A_Generic_Package_Renaming
then
Exist_Node := Add_Child (Result, Node, Children);
elsif Kinds in A_Procedure .. A_Generic_Package then
Second_Unit := Corresponding_Body
(Children, The_Context);
if not Is_Nil (Second_Unit)
and then not Is_Identical (Second_Unit, Children)
then
Exist_Node := Add_Child
(Result, Node, Children, Second_Unit);
Remove_From_List
(Children_List, Index + 1, Second_Unit);
else
Exist_Node := Add_Child (Result, Node, Children);
end if;
elsif Kinds in A_Library_Unit_Body then
Second_Unit := Corresponding_Declaration
(Children, The_Context);
if not Is_Nil (Second_Unit)
and then not Is_Identical (Second_Unit, Children)
then
Exist_Node := Add_Child
(Result, Node, Second_Unit, Children);
Remove_From_List
(Children_List, Index + 1, Second_Unit);
else
Exist_Node := Add_Child (Result, Node, Children);
end if;
else
Exist_Node := Add_Child (Result, Node, Children);
end if;
end if;
end if;
end loop;
end;
-- with --
declare
Units : Asis.Compilation_Unit_List :=
Compilation_Units (The_Context);
Library : Compilation_Unit;
begin
for Index in Units'Range loop
Library := Units (Index);
if not Is_Nil (Library) then
if Have_With (Library, Unit, The_Context) then
Append_To_Node (Library, Node, Glued);
end if;
end if;
end loop;
end;
-- Ada.Exceptions --
if Is_Identical (Unit, Except) then
declare
Units : Asis.Compilation_Unit_List :=
Compilation_Units (The_Context);
Library : Compilation_Unit;
begin
for Index in Units'Range loop
Library := Units (Index);
if not Is_Nil (Library) then
if Have_Except (Library) then
Append_To_Node (Library, Node, Glued);
end if;
end if;
end loop;
end;
end if;
-- System --
if Is_Identical (Unit, Sys) then
declare
Units : Asis.Compilation_Unit_List :=
Compilation_Units (The_Context);
Library : Compilation_Unit;
begin
for Index in Units'Range loop
Library := Units (Index);
if not Is_Nil (Library) then
if Have_Sys (Library) then
Append_To_Node (Library, Node, Glued);
end if;
end if;
end loop;
end;
end if;
declare
Next : Tree_Node_Array_Access := Nexts (Node);
Next_Node : Tree_Node_Access;
Next_Unit : Compilation_Unit;
begin
if Next /= null then
for Index in Next'Range loop
Next_Node := Next (Index);
if Glued = null
or else not Utils.In_List
(Glued, Glued.all'Last, Next_Node)
then
Next_Unit := Get_Spec (Next_Node);
Kinds := Unit_Kind (Next_Unit);
if Kinds in
A_Procedure .. A_Generic_Package_Renaming
then
Retrive (Next_Unit, Next_Node);
elsif Kinds in
A_Procedure_Body .. A_Package_Body
then
Get_Subunits
(Result, Next_Unit, Next_Node, The_Context);
end if;
end if;
end loop;
end if;
end;
Deallocate (Glued);
exception
when others =>
Deallocate (Glued);
raise;
end Retrive;
begin
Dependence_Order (Result, Descending);
for Index in List'Range loop
Unit := List (Index);
if Find (Result, Unit) = null then
Kinds := Unit_Kind (Unit);
if Kinds in A_Procedure .. A_Generic_Package_Renaming then
Body_Unit := Corresponding_Body (Unit, The_Context);
if not Is_Identical (Body_Unit, Unit) then
Retrive (Unit, Add_Child
(Result, null, Unit, Body_Unit, True));
else
Retrive (Unit, null);
end if;
elsif Kinds in A_Procedure_Body .. A_Protected_Body_Subunit then
Get_Subunits
(Result, Unit, Add_Child (Result, null, Unit), The_Context);
end if;
end if;
end loop;
return Result;
exception
when others =>
Deallocate (Result);
raise;
end Get_Dependents;
----------------
-- Get_Family --
----------------
function Get_Family
(List : in Asis.Compilation_Unit_List;
The_Context : in Asis.Context)
return Utils.Root_Tree_Access
is
use Utils;
procedure Retrive
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access);
Result : Root_Tree_Access := new Root_Tree;
Unit, Body_Unit : Compilation_Unit;
Kinds : Unit_Kinds;
-- Retrive --
procedure Retrive
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access)
is
use Utils;
Exist_Node : Tree_Node_Access := null;
Glued : Tree_Node_Array_Access := null;
begin
if Is_Nil (Unit) then
return;
end if;
-- subunits --
if not Is_Nil (Get_Body (Node)) then
Get_Subunits (Result, Get_Body (Node), Node, The_Context);
end if;
-- childrens --
declare
Children_List : Asis.Compilation_Unit_List :=
Corresponding_Children (Unit, The_Context);
Children : Compilation_Unit;
Second_Unit : Compilation_Unit;
begin
for Index in Children_List'Range loop
Children := Children_List (Index);
if not Is_Nil (Children) then
Second_Unit := Nil_Compilation_Unit;
Kinds := Unit_Kind (Children);
Exist_Node := Find (Result, Children);
if Exist_Node /= null then
Glue_Nodes_Checked (Result, Node, Exist_Node);
if Kinds in A_Procedure .. A_Generic_Package then
Second_Unit := Corresponding_Body
(Children, The_Context);
elsif Kinds in A_Library_Unit_Body then
Second_Unit := Corresponding_Declaration
(Children, The_Context);
end if;
if not Is_Nil (Second_Unit)
and then not Is_Identical (Second_Unit, Children)
then
Remove_From_List
(Children_List, Index + 1, Second_Unit);
end if;
else
if Kinds in
A_Procedure_Instance .. A_Generic_Package_Renaming
then
Exist_Node := Add_Child (Result, Node, Children);
elsif Kinds in A_Procedure .. A_Generic_Package then
Second_Unit := Corresponding_Body
(Children, The_Context);
if not Is_Nil (Second_Unit)
and then not Is_Identical (Second_Unit, Children)
then
Exist_Node := Add_Child
(Result, Node, Children, Second_Unit);
Remove_From_List
(Children_List, Index + 1, Second_Unit);
else
Exist_Node := Add_Child (Result, Node, Children);
end if;
elsif Kinds in A_Library_Unit_Body then
Second_Unit := Corresponding_Declaration
(Children, The_Context);
if not Is_Nil (Second_Unit)
and then not Is_Identical (Second_Unit, Children)
then
Exist_Node := Add_Child
(Result, Node, Second_Unit, Children);
Remove_From_List
(Children_List, Index + 1, Second_Unit);
else
Exist_Node := Add_Child (Result, Node, Children);
end if;
else
Exist_Node := Add_Child (Result, Node, Children);
end if;
end if;
end if;
end loop;
end;
declare
Next : Tree_Node_Array_Access := Nexts (Node);
Next_Node : Tree_Node_Access;
Next_Unit : Compilation_Unit;
begin
if Next /= null then
for Index in Next'Range loop
Next_Node := Next (Index);
Next_Unit := Get_Spec (Next_Node);
Kinds := Unit_Kind (Next_Unit);
if Kinds in
A_Procedure .. A_Generic_Package_Renaming
then
Retrive (Next_Unit, Next_Node);
elsif Kinds in
A_Procedure_Body .. A_Package_Body
then
Get_Subunits
(Result, Next_Unit, Next_Node, The_Context);
end if;
end loop;
end if;
end;
end Retrive;
begin
Dependence_Order (Result, Descending);
for Index in List'Range loop
Unit := List (Index);
if Find (Result, Unit) = null then
Kinds := Unit_Kind (Unit);
if Kinds in A_Procedure .. A_Generic_Package_Renaming then
Body_Unit := Corresponding_Body (Unit, The_Context);
elsif Kinds in A_Procedure_Body .. A_Protected_Body_Subunit then
Body_Unit := Unit;
Unit := Corresponding_Declaration (Unit, The_Context);
end if;
if not Is_Identical (Body_Unit, Unit) then
Retrive (Unit, Add_Child (Result, null, Unit, Body_Unit));
else
Retrive (Unit, Add_Child (Result, null, Unit));
end if;
end if;
end loop;
return Result;
exception
when others =>
Deallocate (Result);
raise;
end Get_Family;
----------------------
-- Get_Needed_Units --
----------------------
function Get_Needed_Units
(List : in Asis.Compilation_Unit_List;
The_Context : in Asis.Context)
return Utils.Root_Tree_Access
is
use Utils;
Result : Root_Tree_Access := new Root_Tree;
Unit, Body_Unit : Compilation_Unit;
Kinds : Unit_Kinds;
Std : Compilation_Unit :=
Library_Unit_Declaration ("Standard", The_Context);
procedure Append_Unit
(Unit : in Compilation_Unit;
Node : in out Tree_Node_Access;
Unit_Body : in Compilation_Unit := Nil_Compilation_Unit);
procedure Retrive
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
Add_Node : in Boolean := True);
procedure Retrive_Declarations
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
Add_Node : in Boolean);
procedure Retrive_Body
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
Add_Node : in Boolean);
procedure Retrive_Subunits
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access);
procedure Retrive_With_Clause
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
For_Body : in Boolean := False);
procedure Check_10_1_1_26c_26b
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
For_Body : in Boolean := False);
-- Append_Unit --
procedure Append_Unit
(Unit : in Compilation_Unit;
Node : in out Tree_Node_Access;
Unit_Body : in Compilation_Unit := Nil_Compilation_Unit)
is
Exist_Node : Tree_Node_Access;
begin
Exist_Node := Find (Result, Unit);
if Exist_Node = null then
if Is_Identical (Unit, Std) then
Node := Add_Child
(Result, Node, Unit, Nil_Compilation_Unit, True);
Node := null;
else
Node := Add_Child (Result, Node, Unit, Unit_Body);
end if;
else
if Node /= null then
Glue_Nodes_Checked (Result, Node, Exist_Node);
Node := null;
end if;
end if;
end Append_Unit;
-- Retrive --
procedure Retrive
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
Add_Node : in Boolean := True)
is
Internal_Node : Tree_Node_Access := Node;
begin
if Is_Nil (Unit) then
return;
end if;
Kinds := Unit_Kind (Unit);
if Kinds in A_Nonexistent_Declaration .. An_Unknown_Unit then
null;
elsif Kinds in A_Subunit then
declare
Internal_Unit : Compilation_Unit := Unit;
begin
while Unit_Kind (Internal_Unit) in A_Subunit loop
Internal_Unit := Corresponding_Subunit_Parent_Body
(Internal_Unit, The_Context);
end loop;
Retrive_Declarations
(Corresponding_Declaration (Internal_Unit, The_Context),
Node, Add_Node);
end;
elsif Kinds in A_Procedure_Body .. A_Package_Body then
Retrive_Body (Unit, Node, Add_Node);
else
Retrive_Declarations (Unit, Node, Add_Node);
end if;
end Retrive;
-- Retrive_Declarations --
procedure Retrive_Declarations
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
Add_Node : in Boolean)
is
Parent : Compilation_Unit;
Internal_Node : Tree_Node_Access := Node;
begin
Body_Unit := Corresponding_Body (Unit, The_Context);
if Add_Node then
if not Is_Identical (Body_Unit, Unit) then
Append_Unit (Unit, Internal_Node, Body_Unit);
else
Append_Unit (Unit, Internal_Node);
end if;
if Internal_Node = null then
return;
end if;
end if;
if Is_Identical (Unit, Std) then
return;
end if;
Check_10_1_1_26c_26b (Unit, Internal_Node);
Retrive_With_Clause (Unit, Internal_Node);
if not Is_Nil (Body_Unit) then
Retrive_Body (Body_Unit, Internal_Node, False);
end if;
Parent := Corresponding_Parent_Declaration (Unit, The_Context);
while Unit_Kind (Parent) in
A_Procedure .. A_Generic_Package_Renaming
loop
Body_Unit := Corresponding_Body (Parent, The_Context);
if not Is_Identical (Body_Unit, Parent) then
Append_Unit (Parent, Internal_Node, Body_Unit);
else
Append_Unit (Parent, Internal_Node);
end if;
if Internal_Node = null then
return;
end if;
Check_10_1_1_26c_26b (Parent, Internal_Node);
Retrive_With_Clause (Parent, Internal_Node);
if not Is_Nil (Body_Unit) then
Retrive_Body (Body_Unit, Internal_Node, False);
end if;
Parent := Corresponding_Parent_Declaration (Parent, The_Context);
end loop;
Retrive (Parent, Internal_Node);
end Retrive_Declarations;
-- Retrive_Body --
procedure Retrive_Body
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
Add_Node : in Boolean)
is
Internal_Node : Tree_Node_Access := Node;
begin
if Is_Nil (Unit) then
return;
end if;
if Add_Node then
Append_Unit (Unit, Internal_Node);
if Internal_Node = null then
return;
end if;
end if;
Check_10_1_1_26c_26b (Unit, Internal_Node, True);
Retrive_With_Clause (Unit, Internal_Node, True);
Retrive_Subunits (Unit, Internal_Node);
end Retrive_Body;
-- Retrive_Subunits --
procedure Retrive_Subunits
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access)
is
Sub : Asis.Compilation_Unit_List := Subunits (Unit, The_Context);
Sub_Unit : Compilation_Unit;
Exist_Node : Tree_Node_Access;
vNode : Tree_Node_Access := Node;
begin
for Index in Sub'Range loop
Sub_Unit := Sub (Index);
if not Is_Nil (Sub_Unit) then
Exist_Node := Find (Result, Sub_Unit);
if Exist_Node = null then
Exist_Node := Add_Subunit (Result, Node, Sub_Unit);
Check_10_1_1_26c_26b (Unit, Exist_Node, True);
Retrive_With_Clause (Unit, Exist_Node, True);
Retrive_Subunits (Sub_Unit, Exist_Node);
else
Glue_Nodes (Result, Exist_Node, Node);
end if;
end if;
end loop;
end Retrive_Subunits;
-- Retrive_With_Clause --
procedure Retrive_With_Clause
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
For_Body : in Boolean := False)
is
With_List : constant Asis.Context_Clause_List :=
Asis.Elements.Context_Clause_Elements (Unit);
Internal_Unit : Compilation_Unit;
Exist_Node : Tree_Node_Access;
begin
for Index in With_List'Range loop
if Clause_Kind (With_List (Index).all) = A_With_Clause then
Internal_Unit := Get_Compilation_Unit
(Unit, With_List (Index), Index, The_Context);
if not Is_Nil (Internal_Unit) then
if not For_Body then
Retrive (Internal_Unit, Node);
else
Exist_Node := Find (Result, Internal_Unit);
if Exist_Node = null then
Body_Unit := Corresponding_Body
(Internal_Unit, The_Context);
if not Is_Identical (Body_Unit, Internal_Unit) then
Exist_Node := Add_Child
(Result, null, Internal_Unit, Body_Unit);
else
Exist_Node := Add_Child
(Result, null, Internal_Unit);
end if;
if Node /= null then
Add_Body_Dependents (Result, Exist_Node, Node);
end if;
Retrive (Internal_Unit, Exist_Node, False);
else
if Node /= null then
Add_Body_Dependents (Result, Exist_Node, Node);
end if;
end if;
end if;
end if;
end if;
end loop;
end Retrive_With_Clause;
-- Check_10_1_1_26c_26b --
procedure Check_10_1_1_26c_26b
(Unit : in Compilation_Unit;
Node : in Tree_Node_Access;
For_Body : in Boolean := False)
is
procedure Retrive_For_Body
(Unit : in Compilation_Unit);
Except : Compilation_Unit := Library_Unit_Declaration
("Ada.Exceptions", The_Context);
Sys : Compilation_Unit := Library_Unit_Declaration
("System", The_Context);
State : Check_10_1_1_26c_26b_Information;
-- Retrive_For_Body --
procedure Retrive_For_Body
(Unit : in Compilation_Unit)
is
Exist_Node : Tree_Node_Access;
begin
Exist_Node := Find (Result, Unit);
if Exist_Node = null then
Body_Unit := Corresponding_Body (Unit, The_Context);
if not Is_Identical (Body_Unit, Unit) then
Exist_Node := Add_Child (Result, null, Unit, Body_Unit);
else
Exist_Node := Add_Child (Result, null, Unit);
end if;
if Node /= null then
Add_Body_Dependents (Result, Exist_Node, Node);
end if;
Retrive (Unit, Exist_Node, False);
else
if Node /= null then
Add_Body_Dependents (Result, Exist_Node, Node);
end if;
end if;
end Retrive_For_Body;
begin
State := Check_10_1_1_26c_26b (Unit, The_Context);
if State.Exceptions then
if not For_Body then
Retrive (Except, Node);
else
Retrive_For_Body (Except);
end if;
end if;
if State.System then
if not For_Body then
Retrive (Sys, Node);
else
Retrive_For_Body (Sys);
end if;
end if;
end Check_10_1_1_26c_26b;
begin
Dependence_Order (Result, Ascending);
for Index in List'Range loop
Unit := List (Index);
if Find (Result, Unit) = null then
Retrive (Unit, null);
end if;
end loop;
return Result;
exception
when others =>
Deallocate (Result);
raise;
end Get_Needed_Units;
--------------------
-- Get_Subunits --
--------------------
procedure Get_Subunits
(Tree : in Utils.Root_Tree_Access;
Unit : in Compilation_Unit;
Node : in Utils.Tree_Node_Access;
The_Context : in Asis.Context)
is
use Utils;
Sub : Asis.Compilation_Unit_List := Subunits (Unit, The_Context);
Sub_Unit : Compilation_Unit;
Exist_Node : Tree_Node_Access;
begin
for Index in Sub'Range loop
Sub_Unit := Sub (Index);
if not Is_Nil (Sub_Unit) then
Exist_Node := Find (Tree, Sub_Unit);
if Exist_Node = null then
Exist_Node := Add_Child (Tree, Node, Sub_Unit);
Get_Subunits (Tree, Sub_Unit, Exist_Node, The_Context);
else
Glue_Nodes (Tree, Node, Exist_Node);
end if;
end if;
end loop;
end Get_Subunits;
--------------------------
-- Get_Compilation_Unit --
--------------------------
function Get_Compilation_Unit
(Unit : in Compilation_Unit;
Target : in Asis.Element;
Number : in List_Index;
The_Context : in Asis.Context)
return Asis.Compilation_Unit
is
use Utils;
Names : constant Asis.Name_List := Asis.Clauses.Clause_Names (Target);
Declaration : Asis.Element;
Internal_Unit : Asis.Compilation_Unit;
Result_List : Compilation_Unit_List_Access := null;
begin
for Index in Names'Range loop
if Expression_Kind (Names (Index).all) = An_Identifier then
Declaration := Asis.Expressions.Corresponding_Name_Declaration
(Names (Index));
else
-- A_Selected_Component
Declaration := Asis.Expressions.Corresponding_Name_Declaration
(Asis.Expressions.Selector (Names (Index)));
end if;
if Assigned (Declaration) then
Internal_Unit :=
Asis.Elements.Enclosing_Compilation_Unit (Declaration);
if Unit_Kind (Internal_Unit) in
A_Procedure .. A_Generic_Package_Renaming
then
Result_List := Append (Result_List, Internal_Unit);
end if;
end if;
end loop;
if Result_List = null then
return Nil_Compilation_Unit;
end if;
if Result_List.all'Length > 1 then
Ada.Wide_Text_IO.Put_Line
("[Warning] Founded more then one unit for one with_clause "
& "in unit " & Unit_Full_Name (Unit) & " clause number "
& List_Index'Wide_Image (Number));
end if;
declare
Result : Asis.Compilation_Unit :=
Result_List.all (Result_List.all'First);
begin
Deallocate (Result_List);
if Is_Nil (Result) then
Ada.Wide_Text_IO.Put_Line
("[Warning] Unit for with_clause in unit "
& Unit_Full_Name (Unit) & " clause number "
& List_Index'Wide_Image (Number) & " not found");
else
if Unit_Kind (Result) in A_Procedure_Body .. A_Package_Body then
Result := Corresponding_Declaration (Result, The_Context);
end if;
end if;
return Result;
end;
end Get_Compilation_Unit;
---------------
-- Have_With --
---------------
function Have_With
(Library : in Compilation_Unit;
Unit : in Compilation_Unit;
The_Context : in Asis.Context)
return Boolean
is
With_List : constant Asis.Context_Clause_List :=
Asis.Elements.Context_Clause_Elements (Library);
Internal_Unit : Compilation_Unit;
begin
for Index in With_List'Range loop
if Clause_Kind (With_List (Index).all) = A_With_Clause then
Internal_Unit := Get_Compilation_Unit
(Library, With_List (Index), Index, The_Context);
if not Is_Nil (Internal_Unit)
and then Is_Identical (Internal_Unit, Unit)
then
return True;
end if;
end if;
end loop;
return False;
end Have_With;
--------------------------
-- Check_10_1_1_26c_26b --
--------------------------
function Check_10_1_1_26c_26b
(Unit : in Compilation_Unit;
The_Context : in Asis.Context)
return Check_10_1_1_26c_26b_Information
is
-- 10.1.1 (26.c)
-- 10.1.1 (26.b)
procedure Pre_Operation
(Element : in Asis.Element;
Control : in out Traverse_Control;
State : in out Check_10_1_1_26c_26b_Information);
procedure Post_Operation
(Element : in Asis.Element;
Control : in out Traverse_Control;
State : in out Check_10_1_1_26c_26b_Information);
Except : Compilation_Unit := Library_Unit_Declaration
("Ada.Exceptions", The_Context);
Sys : Compilation_Unit := Library_Unit_Declaration
("System", The_Context);
Is_Except : Boolean;
Is_Sys : Boolean;
Control : Traverse_Control := Continue;
State : Check_10_1_1_26c_26b_Information;
procedure Pre_Operation
(Element : in Asis.Element;
Control : in out Traverse_Control;
State : in out Check_10_1_1_26c_26b_Information)
is
use Asis.Elements;
begin
if not Is_Except
and then Declaration_Kind (Element) =
A_Choice_Parameter_Specification
then
State.Exceptions := True;
end if;
if not Is_Sys
and then Expression_Kind (Element) = An_Attribute_Reference
and then Attribute_Kind (Element) = An_Address_Attribute
then
State.System := True;
end if;
end Pre_Operation;
procedure Post_Operation
(Element : in Asis.Element;
Control : in out Traverse_Control;
State : in out Check_10_1_1_26c_26b_Information)
is
begin
null;
end Post_Operation;
procedure Check_Choice_Iterator is new
Asis.Iterator.Traverse_Element
(Check_10_1_1_26c_26b_Information, Pre_Operation, Post_Operation);
begin
Is_Except := Is_Identical (Unit, Except);
Is_Sys := Is_Identical (Unit, Sys);
Check_Choice_Iterator
(Asis.Elements.Unit_Declaration (Unit), Control, State);
return State;
end Check_10_1_1_26c_26b;
------------
-- Utils --
------------
package body Utils is
-------------
-- In_List --
-------------
function In_List
(List : in Tree_Node_Array_Access;
Last : in Natural;
Node : in Tree_Node_Access)
return Boolean
is
begin
for Index in 1 .. Last loop
if List (Index) = Node then
return True;
end if;
end loop;
return False;
end In_List;
----------------------
-- Dependence_Order --
----------------------
procedure Dependence_Order
(This : in Root_Tree_Access;
Order : in Orders)
is
begin
This.Order := Order;
end Dependence_Order;
---------------
-- Add_Child --
---------------
function Add_Child
(This : in Root_Tree_Access;
Node : in Tree_Node_Access;
Unit : in Compilation_Unit)
return Tree_Node_Access
is
Kinds : Unit_Kinds;
begin
if Is_Nil (Unit) then
return Node;
end if;
declare
New_Node : Tree_Node_Access := new Tree_Node;
begin
Kinds := Unit_Kind (Unit);
if Kinds in A_Procedure .. A_Generic_Package_Renaming
or else Kinds = A_Nonexistent_Declaration
then
New_Node.Unit := Unit;
else
New_Node.Unit_Body := Unit;
end if;
if Node = null then
This.Next := Add_Node (This.Next, New_Node.Self);
else
Node.Next := Add_Node (Node.Next, New_Node.Self);
New_Node.Prevs := Add_Node (New_Node.Prevs, Node.Self);
end if;
This.Units := Add_Node_Ordered (This.Units, New_Node.Self);
return New_Node;
end;
end Add_Child;
-- Add_Child --
function Add_Child
(This : in Root_Tree_Access;
Node : in Tree_Node_Access;
Spec_Unit : in Compilation_Unit;
Body_Unit : in Compilation_Unit;
Skip_Spec : in Boolean := False)
return Tree_Node_Access
is
Kinds : Unit_Kinds;
begin
if Is_Nil (Spec_Unit)
and then Is_Nil (Body_Unit)
then
return Node;
end if;
if not Is_Nil (Spec_Unit) then
Kinds := Unit_Kind (Spec_Unit);
if Kinds not in A_Procedure .. A_Generic_Package_Renaming
and then Kinds = A_Nonexistent_Declaration
then
Asis.Implementation.Set_Status
(Data_Error, "Add_Child - "
& "invalid unit specification "
& Unit_Full_Name (Spec_Unit));
raise Asis.Exceptions.ASIS_Failed;
end if;
end if;
if not Is_Identical (Spec_Unit, Body_Unit) then
if not Is_Nil (Body_Unit) then
Kinds := Unit_Kind (Body_Unit);
if Kinds in A_Procedure .. A_Generic_Package_Renaming
or else Kinds = A_Nonexistent_Declaration
then
Asis.Implementation.Set_Status
(Data_Error, "Add_Child - "
& "invalid unit body " & Unit_Full_Name (Body_Unit));
raise Asis.Exceptions.ASIS_Failed;
end if;
end if;
end if;
declare
New_Node : Tree_Node_Access := new Tree_Node;
begin
New_Node.Unit := Spec_Unit;
if not Is_Identical (Spec_Unit, Body_Unit) then
New_Node.Unit_Body := Body_Unit;
end if;
New_Node.Skip_Spec := Skip_Spec;
if Node = null then
This.Next := Add_Node (This.Next, New_Node.Self);
else
Node.Next := Add_Node (Node.Next, New_Node.Self);
New_Node.Prevs := Add_Node (New_Node.Prevs, Node.Self);
end if;
This.Units := Add_Node_Ordered (This.Units, New_Node.Self);
return New_Node;
end;
end Add_Child;
-----------------
-- Add_Subunit --
-----------------
function Add_Subunit
(This : in Root_Tree_Access;
Node : in Tree_Node_Access;
Unit : in Compilation_Unit)
return Tree_Node_Access
is
Kinds : Unit_Kinds;
begin
if Is_Nil (Unit) then
return Node;
end if;
Kinds := Unit_Kind (Unit);
if Kinds not in
A_Procedure_Body_Subunit .. A_Protected_Body_Subunit
then
Asis.Implementation.Set_Status
(Data_Error, "Add_Subunit - "
& "invalid subunit " & Unit_Full_Name (Unit));
raise Asis.Exceptions.ASIS_Failed;
end if;
declare
New_Node : Tree_Node_Access := new Tree_Node;
begin
New_Node.Unit_Body := Unit;
if Node = null then
This.Next := Add_Node (This.Next, New_Node.Self);
else
Node.Prevs := Add_Node (Node.Prevs, New_Node.Self);
New_Node.Next := Add_Node (New_Node.Next, Node.Self);
end if;
This.Units := Add_Node_Ordered (This.Units, New_Node.Self);
return New_Node;
end;
end Add_Subunit;
------------
-- Append --
------------
procedure Append
(This : in Root_Tree_Access;
Unit : in Compilation_Unit)
is
begin
if Is_Nil (Unit) then
return;
end if;
if Find (This, Unit) /= null then
Asis.Implementation.Set_Status
(Asis.Errors.Internal_Error,
"Elaboration order dublicate unit: " & Unit_Full_Name (Unit));
raise Asis.Exceptions.ASIS_Failed;
end if;
declare
Kinds : Unit_Kinds;
New_Node : Tree_Node_Access := new Tree_Node;
begin
Kinds := Unit_Kind (Unit);
if Kinds in A_Procedure .. A_Generic_Package_Renaming
or else Kinds = A_Nonexistent_Declaration
then
New_Node.Unit := Unit;
else
New_Node.Unit_Body := Unit;
end if;
if This.Last_Node = null then
This.Next := Add_Node (This.Next, New_Node.Self);
else
This.Last_Node.Next := Add_Node
(This.Last_Node.Next, New_Node.Self);
New_Node.Prevs := Add_Node
(New_Node.Prevs, This.Last_Node.Self);
end if;
This.Last_Node := New_Node;
This.Units := Add_Node_Ordered (This.Units, New_Node.Self);
end;
end Append;
----------------
-- Glue_Nodes --
----------------
procedure Glue_Nodes
(This : in Root_Tree_Access;
Node : in Tree_Node_Access;
To_Node : in Tree_Node_Access)
is
begin
if To_Node.Prevs /= null
and then In_List (To_Node.Prevs, To_Node.Prevs'Last, Node)
then
return;
end if;
Node.Next := Add_Node (Node.Next, To_Node.Self);
To_Node.Prevs := Add_Node (To_Node.Prevs, Node.Self);
end Glue_Nodes;
------------------------
-- Glue_Nodes_Checked --
------------------------
procedure Glue_Nodes_Checked
(This : in Root_Tree_Access;
Node : in Tree_Node_Access;
To_Node : in Tree_Node_Access)
is
Circular : Compilation_Unit_List_Access := null;
Prev_Node : Tree_Node_Access := null;
begin
if To_Node.Prevs /= null then
Prev_Node := To_Node.Prevs (To_Node.Prevs.all'First);
if In_List (To_Node.Prevs, To_Node.Prevs'Last, Node) then
return;
end if;
end if;
while Prev_Node /= null loop
if Prev_Node = To_Node then
if Circular /= null then
for Index in reverse Circular.all'Range loop
Node.Circular := Append (Node.Circular, Circular (Index));
end loop;
Node.Circular := Append (Node.Circular, Node.Unit);
Node.Circular := Append
(Node.Circular, Circular (Circular.all'Last));
Deallocate (Circular);
else
-- 2 pair (self and parent)
Node.Circular := Append
(Node.Circular,
(Prev_Node.Unit, Node.Unit, Prev_Node.Unit));
end if;
return;
end if;
Circular := Append (Circular, Prev_Node.Unit);
if Prev_Node.Prevs /= null then
Prev_Node := Prev_Node.Prevs (Prev_Node.Prevs.all'First);
else
Prev_Node := null;
end if;
end loop;
if Circular /= null then
Deallocate (Circular);
end if;
Node.Next := Add_Node (Node.Next, To_Node.Self);
To_Node.Prevs := Add_Node (To_Node.Prevs, Node.Self);
end Glue_Nodes_Checked;
-------------------------
-- Add_Body_Dependents --
-------------------------
procedure Add_Body_Dependents
(This : in Root_Tree_Access;
Node : in Tree_Node_Access;
To_Node : in Tree_Node_Access)
is
begin
Node.Body_Dependences := Add_Node (Node.Body_Dependences, To_Node);
end Add_Body_Dependents;
--------------
-- Is_Child --
--------------
function Is_Child
(This : in Root_Tree_Access;
Node : in Tree_Node_Access)
return Boolean
is
begin
if This.Next /= null then
return In_List (This.Next, This.Next'Last, Node);
else
return False;
end if;
end Is_Child;
----------------
-- Set_Parent --
----------------
procedure Set_Parent
(This : in Root_Tree_Access;
Node : in Tree_Node_Access;
Parent : in Tree_Node_Access)
is
begin
Parent.Next := Add_Node (Parent.Next, Node.Self);
Node.Prevs := Add_Node (Node.Prevs, Parent.Self);
end Set_Parent;
-----------
-- Clear --
-----------
procedure Clear
(This : in out Root_Tree)
is
begin
Finalize (This);
end Clear;
-----------
-- Check --
-----------
procedure Check
(This : in Root_Tree_Access;
The_Context : in Asis.Context)
is
Kinds, Parent_Kinds : Unit_Kinds;
Order : Orders;
procedure Check_Consistent
(Node : in Tree_Node_Access);
function Set_Inconsistent
(Node : in Tree_Node_Access;
Prev : in Tree_Node_Access;
List : in Compilation_Unit_List_Access)
return Compilation_Unit_List_Access;
procedure Check_Body_Consistent
(Node : in Tree_Node_Access);
procedure Check_Missing
(Node : in Tree_Node_Access);
procedure Asc
(Node : in Tree_Node_Access);
procedure Desc
(Node : in Tree_Node_Access);
-- Check_Consistent --
procedure Check_Consistent
(Node : in Tree_Node_Access)
is
Prev_Node : Tree_Node_Access;
begin
if Is_Inconsistent (Node.Unit) then
return;
end if;
Node.Consistent := False;
if Is_Source_Changed (Node.Unit) then
Node.Inconsistent := Append
(Node.Inconsistent, (Nil_Compilation_Unit, Node.Unit));
else
Prev_Node := null;
if Order = Ascending then
if Node.Prevs /= null then
Prev_Node := Node.Prevs (Node.Prevs.all'First);
end if;
else
if Node.Next /= null then
Prev_Node := Node.Next (Node.Next.all'First);
end if;
end if;
if Prev_Node /= null
and then not Is_Nil (Prev_Node.Unit)
then
Node.Inconsistent := Append
(Node.Inconsistent, (Prev_Node.Unit, Node.Unit));
else
Node.Inconsistent := Append
(Node.Inconsistent, (Node.Unit, Node.Unit));
end if;
end if;
if Order = Ascending then
if Node.Next /= null then
for Index in Node.Next.all'Range loop
Node.Inconsistent := Set_Inconsistent
(Node.Next.all (Index), Node, Node.Inconsistent);
end loop;
end if;
else
if Node.Prevs /= null then
for Index in Node.Prevs.all'Range loop
Node.Inconsistent := Set_Inconsistent
(Node.Prevs.all (Index), Node, Node.Inconsistent);
end loop;
end if;
end if;
end Check_Consistent;
-- Set_Inconsistent --
function Set_Inconsistent
(Node : in Tree_Node_Access;
Prev : in Tree_Node_Access;
List : in Compilation_Unit_List_Access)
return Compilation_Unit_List_Access
is
Result : Compilation_Unit_List_Access := List;
begin
if not Node.Consistent
and then Node.Inconsistent /= null
then
if Is_Nil
(Node.Inconsistent (Node.Inconsistent'First))
then
Result := Append
(Result, (Nil_Compilation_Unit, Node.Unit));
end if;
Node.Inconsistent (Node.Inconsistent'First) := Prev.Unit;
Result := Append (Result, Node.Inconsistent.all);
Deallocate (Node.Inconsistent);
return Result;
end if;
if not Is_Nil (Node.Unit) then
Node.Consistent := False;
Result := Append (Result, (Prev.Unit, Node.Unit));
end if;
if Order = Ascending then
if Node.Next /= null then
for Index in Node.Next.all'Range loop
Result := Set_Inconsistent
(Node.Next.all (Index), Node, Result);
end loop;
end if;
else
if Node.Prevs /= null then
for Index in Node.Prevs.all'Range loop
Result := Set_Inconsistent
(Node.Prevs.all (Index), Node, Result);
end loop;
end if;
end if;
return Result;
end Set_Inconsistent;
-- Check_Body_Consistent --
procedure Check_Body_Consistent
(Node : in Tree_Node_Access)
is
procedure Check_Body
(Target : in Tree_Node_Access);
Prev_Unit : Compilation_Unit;
-- Check_Body --
procedure Check_Body
(Target : in Tree_Node_Access)
is
begin
if not Is_Nil (Target.Unit_Body) then
Prev_Unit := Target.Unit_Body;
if not Target.Body_Consistent then
Node.Body_Consistent := False;
Node.Inconsistent := Append
(Node.Inconsistent, (Prev_Unit, Node.Unit_Body));
end if;
end if;
end Check_Body;
begin
if not Is_Nil (Node.Unit_Body) then
if not Node.Consistent then
Node.Body_Consistent := False;
Node.Inconsistent := Append
(Node.Inconsistent, (Node.Unit, Node.Unit_Body));
end if;
if not Is_Inconsistent (Node.Unit_Body) then
Node.Body_Consistent := False;
if Is_Source_Changed (Node.Unit_Body) then
Node.Inconsistent := Append
(Node.Inconsistent,
(Nil_Compilation_Unit, Node.Unit_Body));
else
Node.Inconsistent := Append
(Node.Inconsistent, (Node.Unit_Body, Node.Unit_Body));
end if;
end if;
if Node.Body_Dependences /= null then
for Index in Node.Body_Dependences.all'Range loop
Prev_Unit := Node.Body_Dependences (Index).Unit;
if not Is_Inconsistent (Prev_Unit) then
Node.Body_Consistent := False;
Node.Inconsistent := Append
(Node.Inconsistent, (Prev_Unit, Node.Unit_Body));
end if;
end loop;
end if;
if Unit_Kind (Node.Unit_Body) in A_Subunit then
if Order = Ascending then
if Node.Next /= null then
Check_Body (Node.Next (Node.Next'First));
end if;
else
if Node.Prevs /= null then
Check_Body (Node.Prevs (Node.Prevs'First));
end if;
end if;
end if;
end if;
if Order = Ascending then
if Node.Next /= null then
for Index in Node.Next.all'Range loop
Check_Body_Consistent (Node.Next.all (Index));
end loop;
end if;
else
if Node.Prevs /= null then
for Index in Node.Prevs.all'Range loop
Check_Body_Consistent (Node.Prevs.all (Index));
end loop;
end if;
end if;
end Check_Body_Consistent;
-- Check_Missing --
procedure Check_Missing
(Node : in Tree_Node_Access)
is
procedure Check_Missing
(Node : in Tree_Node_Access;
Target : in Tree_Node_Access)
is
begin
if Target = null
or else Is_Nil (Target.Unit)
then
return;
end if;
Parent_Kinds := Unit_Kind (Target.Unit);
if Parent_Kinds = A_Nonexistent_Declaration then
Node.Missing := Append
(Node.Missing, (Node.Unit, Target.Unit));
end if;
end Check_Missing;
begin
if Node.Missing /= null then
return;
end if;
if Order = Ascending then
if Node.Next /= null then
for Index in Node.Next.all'Range loop
Check_Missing (Node, Node.Next (Index));
end loop;
end if;
else
if Node.Prevs /= null then
for Index in Node.Prevs.all'Range loop
Check_Missing (Node, Node.Prevs (Index));
end loop;
end if;
end if;
if Is_Nil (Node.Unit_Body) then
return;
end if;
if Unit_Kind (Node.Unit) = A_Nonexistent_Declaration then
Node.Missing := Append
(Node.Missing, (Node.Unit_Body, Node.Unit));
end if;
if Node.Body_Dependences /= null then
for Index in Node.Body_Dependences.all'Range loop
Parent_Kinds :=
Unit_Kind (Node.Body_Dependences (Index).Unit);
if Parent_Kinds = A_Nonexistent_Declaration then
Node.Missing := Append
(Node.Missing,
(Node.Unit_Body,
Node.Body_Dependences (Index).Unit));
end if;
end loop;
end if;
if Unit_Kind (Node.Unit_Body) in A_Subunit then
if Order = Ascending then
if Node.Next /= null then
if Unit_Kind
(Node.Next (Node.Next'First).Unit_Body) =
A_Nonexistent_Body
then
Node.Missing := Append
(Node.Missing,
(Node.Unit_Body,
Node.Next (Node.Next'First).Unit_Body));
end if;
end if;
else
if Node.Prevs /= null then
if Unit_Kind
(Node.Prevs (Node.Prevs'First).Unit_Body) =
A_Nonexistent_Body
then
Node.Missing := Append
(Node.Missing,
(Node.Unit_Body,
Node.Prevs (Node.Prevs'First).Unit_Body));
end if;
end if;
end if;
end if;
end Check_Missing;
-- Asc --
procedure Asc
(Node : in Tree_Node_Access)
is
begin
if Node = null then
return;
end if;
if not Is_Nil (Node.Unit) then
if Node.Consistent then
Check_Consistent (Node);
end if;
Check_Missing (Node);
end if;
if Node.Prevs /= null then
for Index in Node.Prevs.all'Range loop
Asc (Node.Prevs.all (Index));
end loop;
end if;
end Asc;
-- Desc --
procedure Desc
(Node : in Tree_Node_Access)
is
begin
if Node = null then
return;
end if;
if not Is_Nil (Node.Unit) then
Kinds := Unit_Kind (Node.Unit);
if Node.Consistent then
Check_Consistent (Node);
end if;
Check_Missing (Node);
end if;
if Node.Next /= null then
for Index in Node.Next.all'Range loop
Desc (Node.Next (Index));
end loop;
end if;
end Desc;
Std_Node : Tree_Node_Access;
begin
Order := This.Order;
if This.Order = Ascending then
Std_Node := Find
(This, Library_Unit_Declaration ("Standard", The_Context));
if Std_Node /= null then
if Std_Node.Next /= null then
for Index in Std_Node.Next.all'Range loop
Asc (Std_Node.Next (Index));
end loop;
for Index in Std_Node.Next.all'Range loop
Check_Body_Consistent (Std_Node.Next (Index));
end loop;
end if;
end if;
else
if This.Next /= null then
for Index in This.Next.all'Range loop
Desc (This.Next (Index));
end loop;
for Index in This.Next.all'Range loop
Check_Body_Consistent (This.Next (Index));
end loop;
end if;
end if;
end Check;
---------------------------
-- Generate_Relationship --
---------------------------
function Generate_Relationship
(This : in Root_Tree_Access;
Limit_List : in Utils.Compilation_Unit_List_Access;
List_Last : in ASIS_Integer)
return Relationship
is
Consistent_List : Compilation_Unit_List_Access := null;
Inconsistent_List : Compilation_Unit_List_Access := null;
Missing_List : Compilation_Unit_List_Access := null;
Circular_List : Compilation_Unit_List_Access := null;
Consistent_Length : Asis.ASIS_Natural := 0;
Inconsistent_Length : Asis.ASIS_Natural := 0;
Missing_Length : Asis.ASIS_Natural := 0;
Circular_Length : Asis.ASIS_Natural := 0;
procedure Genegate_Inconsistent
(Node : in Tree_Node_Access);
procedure Genegate_Circular
(Node : in Tree_Node_Access);
procedure Genegate_Missing
(Node : in Tree_Node_Access);
procedure Process
(Node : in Tree_Node_Access);
-- Genegate_Inconsistent --
procedure Genegate_Inconsistent
(Node : in Tree_Node_Access)
is
begin
if Node.Inconsistent /= null
and then not Node.Inconsistent_Added
then
Node.Inconsistent_Added := True;
if Inconsistent_List = null then
Inconsistent_List := Append
(Inconsistent_List, Node.Inconsistent.all);
else
if not Is_Nil (Node.Inconsistent (Node.Inconsistent'First))
and then Is_Inconsistent
(Node.Inconsistent (Node.Inconsistent'First))
then
Node.Inconsistent (Node.Inconsistent'First) :=
Node.Inconsistent (Node.Inconsistent'First + 1);
end if;
Inconsistent_List := Append
(Inconsistent_List, Node.Inconsistent.all);
end if;
end if;
end Genegate_Inconsistent;
-- Genegate_Circular --
procedure Genegate_Circular
(Node : in Tree_Node_Access)
is
begin
if Node.Circular /= null
and then not Node.Circular_Added
then
Node.Circular_Added := True;
for Index in
Node.Circular.all'First .. Node.Circular.all'Last - 1
loop
Circular_List := Append
(Circular_List, (Node.Circular.all (Index),
Node.Circular.all (Index + 1))
);
end loop;
end if;
end Genegate_Circular;
-- Genegate_Missing --
procedure Genegate_Missing
(Node : in Tree_Node_Access)
is
begin
if Node.Missing /= null
and then not Node.Missing_Added
then
Node.Missing_Added := True;
Missing_List := Append (Missing_List, Node.Missing.all);
end if;
end Genegate_Missing;
-- Process --
procedure Process
(Node : in Tree_Node_Access)
is
-- Add_To_Consistent --
procedure Add_To_Consistent
(Unit : in Compilation_Unit)
is
begin
if Limit_List /= null then
if In_List (Limit_List, List_Last, Unit) then
Consistent_List := Append (Consistent_List, Unit);
end if;
else
Consistent_List := Append (Consistent_List, Unit);
end if;
end Add_To_Consistent;
begin
if Node.Added then
return;
end if;
Node.Added := True;
if Node.Consistent then
if not Node.Skip_Spec
and then not Is_Nil (Node.Unit)
then
Add_To_Consistent (Node.Unit);
end if;
if Node.Body_Consistent
and then not Is_Nil (Node.Unit_Body)
then
Add_To_Consistent (Node.Unit_Body);
end if;
end if;
Genegate_Inconsistent (Node);
Genegate_Missing (Node);
Genegate_Circular (Node);
if Node.Next /= null then
for Index in Node.Next.all'Range loop
Process (Node.Next.all (Index));
end loop;
end if;
end Process;
begin
if This.Next = null then
return Nil_Relationship;
end if;
for Index in This.Next.all'Range loop
Process (This.Next.all (Index));
end loop;
if Consistent_List /= null then
Consistent_Length := Consistent_List.all'Length;
end if;
if Inconsistent_List /= null then
Inconsistent_Length := Inconsistent_List.all'Length;
end if;
if Missing_List /= null then
Missing_Length := Missing_List.all'Length;
end if;
if Circular_List /= null then
Circular_Length := Circular_List.all'Length;
end if;
declare
Result : Relationship
(Consistent_Length, Inconsistent_Length,
Missing_Length, Circular_Length);
begin
if Consistent_List /= null then
Result.Consistent := Consistent_List.all;
end if;
if Inconsistent_List /= null then
Result.Inconsistent := Inconsistent_List.all;
end if;
if Missing_List /= null then
Result.Missing := Missing_List.all;
end if;
if Circular_List /= null then
Result.Circular := Circular_List.all;
end if;
Deallocate (Consistent_List);
Deallocate (Inconsistent_List);
Deallocate (Missing_List);
Deallocate (Circular_List);
return Result;
end;
exception
when others =>
Deallocate (Consistent_List);
Deallocate (Inconsistent_List);
Deallocate (Missing_List);
Deallocate (Circular_List);
raise;
end Generate_Relationship;
----------------------------------
-- Is_Have_Circular_Dependences --
----------------------------------
function Is_Have_Circular_Dependences
(This : in Root_Tree_Access)
return Boolean
is
function Process
(Node : in Tree_Node_Access)
return Boolean;
Result : Boolean := False;
-- Process --
function Process
(Node : in Tree_Node_Access)
return Boolean
is
Result : Boolean := False;
begin
if Node.Circular /= null then
return True;
else
if Node.Next /= null then
for Index in Node.Next.all'Range loop
Result := Process (Node.Next.all (Index));
exit when Result;
end loop;
end if;
end if;
return Result;
end Process;
begin
if This.Next /= null then
for Index in This.Next.all'Range loop
Result := Process (This.Next.all (Index));
exit when Result;
end loop;
end if;
return Result;
end Is_Have_Circular_Dependences;
-----------------------------
-- Create_Elaboration_Tree --
-----------------------------
-- A_Partition_Elaboration_Policy_Pragma, -- H.6 (3)
-- A_Preelaborable_Initialization_Pragma, -- 7.6 (5)
function Create_Elaboration_Tree
(This : in Root_Tree_Access;
The_Context : in Asis.Context)
return Root_Tree_Access
is
procedure Process_Pure_Spec
(Node : in Tree_Node_Access);
procedure Process_Pure_Body
(Node : in Tree_Node_Access);
procedure Process_Preelaborate_Spec
(Node : in Tree_Node_Access);
procedure Process_Preelaborate_Body
(Node : in Tree_Node_Access);
procedure Process_Spec
(Node : in Tree_Node_Access);
procedure Process_Body
(Node : in Tree_Node_Access);
procedure Elab_Spec
(Node : in Tree_Node_Access);
procedure Elab_Body
(Node : in Tree_Node_Access;
All_Bodys : in Boolean := False;
Only_Body : in Boolean := True);
procedure Elab_Subunits
(Node : in Tree_Node_Access;
All_Bodys : in Boolean);
procedure Elab_Pragmed_Bodys
(Node : in Tree_Node_Access;
Unit : in Compilation_Unit);
procedure Append_Inconsistent
(Node : in Tree_Node_Access);
Result : Root_Tree_Access := new Root_Tree;
Root_Node : Tree_Node_Access;
Std : Compilation_Unit :=
Library_Unit_Declaration ("Standard", The_Context);
-- for circular elaboration order
Elaboration_Line : Compilation_Unit_List_Access := null;
procedure Elab_Spec
(Node : in Tree_Node_Access)
is
begin
if not Node.Elaborated
and then Node.Consistent
and then not Is_Nil (Node.Unit)
then
if Elaboration_Line /= null then
-- test circular --
if In_List
(Elaboration_Line, Elaboration_Line.all'Last, Node.Unit)
then
Node.Circular := Append
(Node.Circular, Elaboration_Line.all);
return;
end if;
end if;
Elaboration_Line := Append
(Elaboration_Line, Node.Unit);
if Node.Next /= null then
for Index in Node.Next.all'Range loop
Elab_Spec (Node.Next (Index));
end loop;
end if;
Elab_Pragmed_Bodys (Node, Node.Unit);
Append (Result, Node.Unit);
Node.Elaborated := True;
Remove_From_List (Elaboration_Line, Node.Unit);
end if;
if Is_Elaborate_Body (Node) then
-- An_Elaborate_Body_Pragma -- 10.2.1(22)
Elab_Body (Node);
end if;
end Elab_Spec;
-- Elab_Body --
procedure Elab_Body
(Node : in Tree_Node_Access;
All_Bodys : in Boolean := False;
Only_Body : in Boolean := True)
is
Unit : Compilation_Unit := Node.Unit_Body;
begin
if Node.Body_Elaborated then
Elab_Subunits (Node, All_Bodys);
return;
end if;
if not Node.Body_Consistent
or else Is_Nil (Unit)
then
return;
end if;
if Only_Body
and then Unit_Kind (Unit) not in
A_Procedure_Body .. A_Package_Body
then
return;
end if;
if not Only_Body
and then Unit_Kind (Unit) not in A_Subunit
then
Elab_Subunits (Node, All_Bodys);
return;
end if;
if Elaboration_Line /= null then
-- test circular --
if In_List
(Elaboration_Line, Elaboration_Line.all'Last, Unit)
then
Node.Circular := Append
(Node.Circular, Elaboration_Line.all);
return;
end if;
end if;
Elaboration_Line := Append (Elaboration_Line, Unit);
if Node.Body_Dependences /= null then
for Index in Node.Body_Dependences.all'Range loop
Elab_Spec (Node.Body_Dependences (Index));
end loop;
end if;
Elab_Pragmed_Bodys (Node, Unit);
if All_Bodys then
if Node.Body_Dependences /= null then
for Index in Node.Body_Dependences.all'Range loop
Elab_Body (Node.Body_Dependences (Index), True, True);
end loop;
end if;
end if;
Append (Result, Unit);
Node.Body_Elaborated := True;
Remove_From_List (Elaboration_Line, Unit);
Elab_Subunits (Node, All_Bodys);
end Elab_Body;
-- Elab_Subunits --
procedure Elab_Subunits
(Node : in Tree_Node_Access;
All_Bodys : in Boolean)
is
Next_Node : Tree_Node_Access;
begin
if not Node.Body_Elaborated then
return;
end if;
if Node.Prevs /= null then
for Index in Node.Prevs.all'Range loop
Next_Node := Node.Prevs (Index);
if Unit_Kind (Next_Node.Unit_Body) in
A_Procedure_Body_Subunit .. A_Protected_Body_Subunit
then
Elab_Body (Next_Node, All_Bodys, False);
end if;
end loop;
end if;
end Elab_Subunits;
-- Elab_Pragmed_Bodys --
procedure Elab_Pragmed_Bodys
(Node : in Tree_Node_Access;
Unit : in Compilation_Unit)
is
-- An_Elaborate_Pragma -- 10.2.1(20)
-- An_Elaborate_All_Pragma -- 10.2.1(21)
use Asis.Elements;
With_List : constant Asis.Context_Clause_List :=
Context_Clause_Elements (Unit, True);
El : Element;
Internal_Unit : Compilation_Unit;
begin
for Index in With_List'Range loop
El := With_List (Index);
if Element_Kind (El) = A_Pragma then
if Pragma_Kind (El) = An_Elaborate_Pragma then
Internal_Unit := Get_Compilation_Unit
(Unit, With_List (Index), Index, The_Context);
Elab_Body (Find (Result, Internal_Unit));
elsif Pragma_Kind (El) = An_Elaborate_All_Pragma then
Internal_Unit := Get_Compilation_Unit
(Unit, With_List (Index), Index, The_Context);
Elab_Body (Find (Result, Internal_Unit), True);
end if;
end if;
end loop;
end Elab_Pragmed_Bodys;
-- Process_Pure_Spec --
procedure Process_Pure_Spec
(Node : in Tree_Node_Access)
is
-- A_Pure_Pragma -- 10.2.1(14)
begin
if not Node.Elaborated
and then not Is_Nil (Node.Unit)
then
if Is_Pure (Node) then
Elab_Spec (Node);
end if;
end if;
if Node.Prevs /= null then
for Index in Node.Prevs.all'Range loop
Process_Pure_Spec (Node.Prevs (Index));
end loop;
end if;
end Process_Pure_Spec;
-- Process_Pure_Body --
procedure Process_Pure_Body
(Node : in Tree_Node_Access)
is
-- A_Pure_Pragma -- 10.2.1(14)
begin
if Is_Pure (Node) then
Elab_Body (Node);
end if;
if Node.Prevs /= null then
for Index in Node.Prevs.all'Range loop
Process_Pure_Body (Node.Prevs (Index));
end loop;
end if;
end Process_Pure_Body;
-- Process_Preelaborate_Spec --
procedure Process_Preelaborate_Spec
(Node : in Tree_Node_Access)
is
-- A_Preelaborate_Pragma -- 10.2.1(3)
begin
if not Node.Elaborated
and then not Is_Nil (Node.Unit)
then
if Is_Preelaborate (Node) then
Elab_Spec (Node);
end if;
end if;
if Node.Prevs /= null then
for Index in Node.Prevs.all'Range loop
Process_Preelaborate_Spec (Node.Prevs (Index));
end loop;
end if;
end Process_Preelaborate_Spec;
-- Process_Preelaborate_Body --
procedure Process_Preelaborate_Body
(Node : in Tree_Node_Access)
is
-- A_Preelaborate_Pragma -- 10.2.1(3)
begin
if Is_Preelaborate (Node) then
Elab_Body (Node);
end if;
if Node.Prevs /= null then
for Index in Node.Prevs.all'Range loop
Process_Preelaborate_Body (Node.Prevs (Index));
end loop;
end if;
end Process_Preelaborate_Body;
-- Process_Spec --
procedure Process_Spec
(Node : in Tree_Node_Access)
is
begin
if not Node.Elaborated
and then not Is_Nil (Node.Unit)
then
Elab_Spec (Node);
end if;
if Node.Prevs /= null then
for Index in Node.Prevs.all'Range loop
Process_Spec (Node.Prevs (Index));
end loop;
end if;
end Process_Spec;
-- Process_Body --
procedure Process_Body
(Node : in Tree_Node_Access)
is
begin
Elab_Body (Node);
if Node.Prevs /= null then
for Index in Node.Prevs.all'Range loop
Process_Body (Node.Prevs (Index));
end loop;
end if;
end Process_Body;
-- Append_Inconsistent --
procedure Append_Inconsistent
(Node : in Tree_Node_Access)
is
begin
if Node.Inconsistent /= null then
Result.Next (Result.Next'First).Inconsistent :=
Append (Result.Next (Result.Next'First).Inconsistent,
Node.Inconsistent.all);
end if;
if Node.Prevs /= null then
for Index in Node.Prevs.all'Range loop
Append_Inconsistent (Node.Prevs (Index));
end loop;
end if;
end Append_Inconsistent;
begin
Root_Node := Find (This, Std);
Root_Node.Elaborated := True;
Append (Result, Std);
if Root_Node.Prevs = null then
return Result;
end if;
for Index in Root_Node.Prevs.all'Range loop
Deallocate (Elaboration_Line);
Process_Pure_Spec (Root_Node.Prevs (Index));
end loop;
for Index in Root_Node.Prevs.all'Range loop
Deallocate (Elaboration_Line);
Process_Pure_Body (Root_Node.Prevs (Index));
end loop;
for Index in Root_Node.Prevs.all'Range loop
Deallocate (Elaboration_Line);
Process_Preelaborate_Spec (Root_Node.Prevs (Index));
end loop;
for Index in Root_Node.Prevs.all'Range loop
Deallocate (Elaboration_Line);
Process_Preelaborate_Body (Root_Node.Prevs (Index));
end loop;
for Index in Root_Node.Prevs.all'Range loop
Deallocate (Elaboration_Line);
Process_Spec (Root_Node.Prevs (Index));
end loop;
for Index in Root_Node.Prevs.all'Range loop
Deallocate (Elaboration_Line);
Process_Body (Root_Node.Prevs (Index));
end loop;
-- inconsistent
for Index in Root_Node.Prevs.all'Range loop
Append_Inconsistent (Root_Node.Prevs (Index));
end loop;
return Result;
exception
when others =>
Deallocate (Result);
raise;
end Create_Elaboration_Tree;
-------------
-- Is_Pure --
-------------
function Is_Pure
(This : in Tree_Node_Access)
return Boolean
is
begin
if This.Internal_Pure = Unknown then
Retrive_Pragmas (This);
end if;
if This.Internal_Pure = Extended_True then
return True;
else
return False;
end if;
end Is_Pure;
---------------------
-- Is_Preelaborate --
---------------------
function Is_Preelaborate
(This : in Tree_Node_Access)
return Boolean
is
begin
if This.Internal_Preelaborate = Unknown then
Retrive_Pragmas (This);
end if;
if This.Internal_Preelaborate = Extended_True then
return True;
else
return False;
end if;
end Is_Preelaborate;
-----------------------
-- Is_Elaborate_Body --
-----------------------
function Is_Elaborate_Body
(This : in Tree_Node_Access)
return Boolean
is
begin
if This.Internal_Spec_With_Body = Unknown then
Retrive_Pragmas (This);
end if;
if This.Internal_Spec_With_Body = Extended_True then
return True;
else
return False;
end if;
end Is_Elaborate_Body;
---------------------
-- Retrive_Pragmas --
---------------------
procedure Retrive_Pragmas
(This : in Tree_Node_Access)
is
begin
if Is_Nil (This.Unit) then
return;
end if;
declare
Pragma_List : constant Asis.Pragma_Element_List :=
Asis.Elements.Corresponding_Pragmas
(Asis.Elements.Unit_Declaration (This.Unit));
begin
for Index in Pragma_List'Range loop
if Pragma_Kind (Pragma_List (Index).all) = A_Pure_Pragma then
This.Internal_Pure := Extended_True;
end if;
if Pragma_Kind (Pragma_List (Index).all) =
A_Preelaborate_Pragma
then
This.Internal_Preelaborate := Extended_True;
end if;
if Pragma_Kind (Pragma_List (Index).all) =
An_Elaborate_Body_Pragma
then
This.Internal_Spec_With_Body := Extended_True;
end if;
end loop;
end;
if This.Internal_Pure = Unknown then
This.Internal_Pure := Extended_False;
end if;
if This.Internal_Preelaborate = Extended_True then
This.Internal_Preelaborate := Extended_False;
end if;
if This.Internal_Spec_With_Body = Unknown then
This.Internal_Spec_With_Body := Extended_False;
end if;
end Retrive_Pragmas;
------------------
-- Is_Skip_Spec --
------------------
function Is_Skip_Spec
(This : in Tree_Node_Access)
return Boolean
is
begin
return This.Skip_Spec;
end Is_Skip_Spec;
---------------
-- Skip_Spec --
---------------
procedure Skip_Spec
(This : in Tree_Node_Access;
Value : in Boolean)
is
begin
This.Skip_Spec := Value;
end Skip_Spec;
--------------
-- Get_Spec --
--------------
function Get_Spec
(This : in Tree_Node_Access)
return Compilation_Unit
is
begin
return This.Unit;
end Get_Spec;
--------------
-- Get_Body --
--------------
function Get_Body
(This : in Tree_Node_Access)
return Compilation_Unit
is
begin
return This.Unit_Body;
end Get_Body;
-----------
-- Nexts --
-----------
function Nexts
(This : in Tree_Node_Access)
return Tree_Node_Array_Access
is
begin
return This.Next;
end Nexts;
--------------
-- Finalize --
--------------
procedure Finalize
(This : in out Root_Tree)
is
Node : Tree_Node_Access;
begin
if This.Next /= null then
for Index in This.Next.all'Range loop
Node := This.Next.all (Index);
if Node /= null then
Deallocate (Node);
end if;
end loop;
Deallocate (This.Next);
end if;
Deallocate (This.Units);
end Finalize;
-- Finalize --
procedure Finalize
(This : in out Tree_Node)
is
Node : Tree_Node_Access;
begin
if This.Next /= null then
for Index in This.Next.all'Range loop
Node := This.Next.all (Index);
if Node /= null then
Deallocate (Node);
end if;
end loop;
Deallocate (This.Next);
end if;
if This.Prevs /= null then
for Index in This.Prevs.all'Range loop
Remove (This.Prevs (Index).Next, This.Self);
end loop;
Deallocate (This.Prevs);
end if;
Deallocate (This.Circular);
Deallocate (This.Missing);
Deallocate (This.Inconsistent);
Deallocate (This.Body_Dependences);
end Finalize;
----------
-- Find --
----------
function Find
(This : in Root_Tree_Access;
Unit : in Compilation_Unit)
return Tree_Node_Access
is
Index : aliased Positive;
begin
if This.Units = null then
return null;
end if;
if Find
(This.Units, Unit, 1, This.Units.all'Last, Index'Unchecked_Access)
then
return This.Units.all (Index).Node;
else
return null;
end if;
end Find;
------------
-- Append --
------------
function Append
(List : in Tree_Node_Array_Access;
Node : in Tree_Node_Access)
return Tree_Node_Array_Access
is
begin
return Add_Node (List, Node);
end Append;
--------------
-- Add_Node --
--------------
function Add_Node
(List : in Tree_Node_Array_Access;
Node : in Tree_Node_Access)
return Tree_Node_Array_Access
is
Array_Access : Tree_Node_Array_Access := List;
begin
if Array_Access = null then
Array_Access := new Tree_Node_Array (1 .. 1);
else
declare
Tmp_Array : Tree_Node_Array_Access :=
new Tree_Node_Array (1 .. Array_Access.all'Length + 1);
begin
Tmp_Array (1 .. Array_Access.all'Length) := Array_Access.all;
Deallocate (Array_Access);
Array_Access := Tmp_Array;
end;
end if;
Array_Access.all (Array_Access.all'Last) := Node;
return Array_Access;
end Add_Node;
------------
-- Remove --
------------
procedure Remove
(List : in out Tree_Node_Array_Access;
Node : in Tree_Node_Access)
is
begin
if List = null or else Node = null then
return;
end if;
for Index in List'Range loop
if List (Index) = Node then
List (Index) := null;
return;
end if;
end loop;
end Remove;
-- Remove --
function Remove
(List : in Tree_Node_Array_Access;
Node : in Tree_Node_Access)
return Tree_Node_Array_Access
is
Internal_List : Tree_Node_Array_Access := List;
begin
if Internal_List = null
or else Node = null
then
return Internal_List;
end if;
for Index in List'Range loop
if Internal_List (Index) = Node then
if List'Length = 1 then
Deallocate (Internal_List);
return null;
else
declare
New_Arry : constant Tree_Node_Array_Access :=
new Tree_Node_Array (1 .. List'Length - 1);
begin
New_Arry (1 .. Index - 1) := List (1 .. Index - 1);
New_Arry (Index .. New_Arry'Last) :=
List (Index + 1 .. List'Last);
Deallocate (Internal_List);
return New_Arry;
end;
end if;
end if;
end loop;
return List;
end Remove;
----------------------
-- Add_Node_Ordered --
----------------------
function Add_Node_Ordered
(List : in Unit_Node_Array_Access;
Node : in Tree_Node_Access)
return Unit_Node_Array_Access
is
procedure Process
(Unit : Compilation_Unit);
Array_Access : Unit_Node_Array_Access := List;
Index : aliased Positive;
procedure Process
(Unit : Compilation_Unit)
is
begin
if Array_Access = null then
Array_Access := new Unit_Node_Array (1 .. 1);
Array_Access.all (1) := (Unit, Node);
else
if Find
(Array_Access, Unit,
1, Array_Access.all'Last, Index'Unchecked_Access)
then
raise Use_Error;
end if;
declare
Tmp_Array : Unit_Node_Array_Access :=
new Unit_Node_Array (1 .. Array_Access.all'Length + 1);
begin
Tmp_Array (1 .. Index - 1) :=
Array_Access.all (1 .. Index - 1);
Tmp_Array (Index) := (Unit, Node);
Tmp_Array (Index + 1 .. Tmp_Array.all'Last) :=
Array_Access.all (Index .. Array_Access.all'Last);
Deallocate (Array_Access);
Array_Access := Tmp_Array;
end;
end if;
end Process;
begin
if not Is_Nil (Node.Unit) then
Process (Node.Unit);
end if;
if not Is_Nil (Node.Unit_Body) then
Process (Node.Unit_Body);
end if;
return Array_Access;
end Add_Node_Ordered;
----------
-- Find --
----------
function Find
(List : in Unit_Node_Array_Access;
Unit : in Compilation_Unit;
From : in Positive;
To : in Positive;
Index : in Positive_Access)
return Boolean
is
L, H, I : Natural;
C : Integer;
Result : Boolean := False;
begin
L := From;
H := To;
while L <= H loop
I := (L + H) / 2;
C := Compare (List.all (I).Unit, Unit);
if C < 0 then
L := I + 1;
else
H := I - 1;
if C = 0 then
Result := True;
L := I;
end if;
end if;
end loop;
Index.all := L;
return Result;
end Find;
-------------
-- Compare --
-------------
function Compare
(Left : in Compilation_Unit;
Right : in Compilation_Unit)
return Integer
is
use Asis;
use System;
begin
if Left.all'Address < Right.all'Address then
return -1;
elsif Left.all'Address > Right.all'Address then
return 1;
else
return 0;
end if;
end Compare;
-------------
-- In_List --
-------------
function In_List
(List : in Compilation_Unit_List_Access;
Last : in ASIS_Integer;
Unit : in Compilation_Unit)
return Boolean
is
begin
for Index in 1 .. Last loop
if Asis.Compilation_Units.Is_Identical (List (Index), Unit) then
return True;
end if;
end loop;
return False;
end In_List;
----------------------
-- Remove_From_List --
----------------------
procedure Remove_From_List
(List : in out Compilation_Unit_List_Access;
Unit : in Compilation_Unit)
is
begin
if List = null then
return;
end if;
for Index in List'Range loop
if Is_Identical (List (Index), Unit) then
if List'Length = 1 then
Deallocate (List);
else
declare
Internal : constant Compilation_Unit_List_Access :=
new Compilation_Unit_List (1 .. List'Length - 1);
begin
Internal (1 .. Index - 1) := List (1 .. Index - 1);
Internal (Index .. Internal'Last) :=
List (Index + 1 .. List'Last);
Deallocate (List);
List := Internal;
end;
end if;
exit;
end if;
end loop;
end Remove_From_List;
-- Remove_From_List --
procedure Remove_From_List
(List : in out Compilation_Unit_List;
From : in List_Index;
Unit : in Compilation_Unit)
is
begin
for Index in From .. List'Last loop
if Is_Identical (List (Index), Unit) then
List (Index) := Nil_Compilation_Unit;
return;
end if;
end loop;
end Remove_From_List;
------------
-- Append --
------------
function Append
(List : in Compilation_Unit_List_Access;
Unit : in Compilation_Unit)
return Compilation_Unit_List_Access
is
Result : Compilation_Unit_List_Access := List;
begin
if Result = null then
Result := new Compilation_Unit_List (1 .. 1);
else
declare
Tmp_Array : Compilation_Unit_List_Access :=
new Compilation_Unit_List (1 .. Result.all'Length + 1);
begin
Tmp_Array (1 .. Result.all'Length) := Result.all;
Deallocate (Result);
Result := Tmp_Array;
end;
end if;
Result.all (Result.all'Last) := Unit;
return Result;
end Append;
-- Append --
function Append
(List : in Compilation_Unit_List_Access;
Units : in Compilation_Unit_List)
return Compilation_Unit_List_Access
is
Result : Compilation_Unit_List_Access := List;
begin
if Result = null then
Result := new Compilation_Unit_List (1 .. Units'Length);
Result.all := Units;
else
declare
Tmp_Array : Compilation_Unit_List_Access :=
new Compilation_Unit_List
(1 .. Result.all'Length + Units'Length);
begin
Tmp_Array (1 .. Result.all'Length) := Result.all;
Tmp_Array (Result.all'Length + 1 .. Tmp_Array'Last) := Units;
Deallocate (Result);
Result := Tmp_Array;
end;
end if;
return Result;
end Append;
---------------------
-- Is_Inconsistent --
---------------------
function Is_Inconsistent
(Unit : in Compilation_Unit)
return Boolean
is
begin
return True;
end Is_Inconsistent;
-----------------------
-- Is_Source_Changed --
-----------------------
function Is_Source_Changed
(Unit : in Compilation_Unit)
return Boolean
is
begin
return False;
end Is_Source_Changed;
end Utils;
end Asis.Compilation_Units.Relations;
------------------------------------------------------------------------------
-- Copyright (c) 2006-2013, Maxim Reznik, Andry Ogorodnik
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
-- * Neither the name of the Maxim Reznik, IE nor the names of its
-- contributors may be used to endorse or promote products derived from
-- this software without specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . V A L U E _ I --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2021, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains routines for scanning signed integer values for use
-- in Text_IO.Integer_IO, and the Value attribute.
generic
type Int is range <>;
type Uns is mod <>;
with function Scan_Raw_Unsigned
(Str : String;
Ptr : not null access Integer;
Max : Integer) return Uns;
package System.Value_I is
pragma Preelaborate;
function Scan_Integer
(Str : String;
Ptr : not null access Integer;
Max : Integer) return Int;
-- This function scans the string starting at Str (Ptr.all) for a valid
-- integer according to the syntax described in (RM 3.5(43)). The substring
-- scanned extends no further than Str (Max). There are three cases for the
-- return:
--
-- If a valid integer is found after scanning past any initial spaces, then
-- Ptr.all is updated past the last character of the integer (but trailing
-- spaces are not scanned out).
--
-- If no valid integer is found, then Ptr.all points either to an initial
-- non-digit character, or to Max + 1 if the field is all spaces and the
-- exception Constraint_Error is raised.
--
-- If a syntactically valid integer is scanned, but the value is out of
-- range, or, in the based case, the base value is out of range or there
-- is an out of range digit, then Ptr.all points past the integer, and
-- Constraint_Error is raised.
--
-- Note: these rules correspond to the requirements for leaving the pointer
-- positioned in Text_Io.Get
--
-- Note: if Str is null, i.e. if Max is less than Ptr, then this is a
-- special case of an all-blank string, and Ptr is unchanged, and hence
-- is greater than Max as required in this case.
function Value_Integer (Str : String) return Int;
-- Used in computing X'Value (Str) where X is a signed integer type whose
-- base range does not exceed the base range of Integer. Str is the string
-- argument of the attribute. Constraint_Error is raised if the string is
-- malformed, or if the value is out of range.
end System.Value_I;
|
--*****************************************************************************
--*
--* PROJECT: BingAda
--*
--* FILE: q_sound.asfml.adb
--*
--* AUTHOR: Manuel <mgrojo at github>
--*
--*****************************************************************************
-- External sound library
--
with Sf.Audio.Music;
with Ada.Directories;
with Ada.Strings.Fixed;
with Gtkada.Intl;
with Q_Bingo;
package body Q_Sound is
use type Sf.Audio.sfMusic_Ptr;
type T_Sound_Array is array (Q_Bingo.T_Number) of Sf.Audio.sfMusic_Ptr;
V_Sounds : T_Sound_Array;
--==================================================================
function F_Filename (V_Number : Positive) return String is
C_Number_Image : constant String := Ada.Strings.Fixed.Trim
(V_Number'Image, Ada.Strings.Left);
C_Path : constant String := "media/";
C_Extension : constant String := ".ogg";
C_Lang_Code_Last : constant := 2;
C_Locale : constant String := Gtkada.Intl.Getlocale;
C_Default_Lang : constant String := "en";
V_Lang : String (1 .. C_Lang_Code_Last) := C_Default_Lang;
begin
if C_Locale'Length >= C_Lang_Code_Last then
V_Lang := C_Locale (C_Locale'First ..
C_Locale'First + C_Lang_Code_Last - 1);
end if;
if not Ada.Directories.Exists
(C_Path & V_Lang & '/' & C_Number_Image & C_Extension) then
V_Lang := C_Default_Lang;
end if;
return C_Path & V_Lang & '/' & C_Number_Image & C_Extension;
end F_Filename;
--==================================================================
procedure P_Play_Number (V_Number : Positive) is
begin
if V_Sounds (V_Number) = null then
V_Sounds (V_Number) := Sf.Audio.Music.createFromFile
(F_Filename (V_Number));
end if;
Sf.Audio.Music.play (V_Sounds (V_number));
end P_Play_Number;
--==================================================================
procedure P_Clean_Up is
begin
for V_Music of V_Sounds loop
if V_Music /= null then
Sf.Audio.Music.destroy (V_Music);
end if;
end loop;
end p_clean_up;
end Q_Sound;
|
with Tkmrpc.Request;
with Tkmrpc.Response;
package Tkmrpc.Dispatchers.Ees is
procedure Dispatch
(Req : Request.Data_Type;
Res : out Response.Data_Type);
-- Dispatch EES request to concrete operation handler.
end Tkmrpc.Dispatchers.Ees;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Testsuite 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 test checks implementation of Index operations of
-- Universal_String_Vector.
------------------------------------------------------------------------------
with League.Strings;
with League.String_Vectors;
procedure Test_177 is
use League.Strings;
use League.String_Vectors;
A1 : constant Universal_String := To_Universal_String ("a");
A2 : constant Universal_String := To_Universal_String ("b");
A3 : constant Universal_String := To_Universal_String ("c");
V : Universal_String_Vector;
begin
-- Initialize Universal_String_Vector.
V.Append (A1);
V.Append (A2);
V.Append (A3);
if V.Index (A2) /= 2 then
raise Program_Error;
end if;
if V.Index ("c") /= 3 then
raise Program_Error;
end if;
if V.Index ("d") /= 0 then
raise Program_Error;
end if;
end Test_177;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S E M _ S M E M --
-- --
-- B o d y --
-- --
-- Copyright (C) 1998-2000, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Atree; use Atree;
with Einfo; use Einfo;
with Errout; use Errout;
with Namet; use Namet;
with Sinfo; use Sinfo;
with Snames; use Snames;
package body Sem_Smem is
function Contains_Access_Type (T : Entity_Id) return Boolean;
-- This function determines if type T is an access type, or contains
-- a component (array, record, protected type cases) that contains
-- an access type (recursively defined in the appropriate manner).
----------------------
-- Check_Shared_Var --
----------------------
procedure Check_Shared_Var
(Id : Entity_Id;
T : Entity_Id;
N : Node_Id)
is
begin
-- We cannot tolerate aliased variables, because they might be
-- modified via an aliased pointer, and we could not detect that
-- this was happening (to update the corresponding shared memory
-- file), so we must disallow all use of Aliased
if Aliased_Present (N) then
Error_Msg_N
("aliased variables " &
"not supported in Shared_Passive partitions",
N);
-- We can't support access types at all, since they are local
-- pointers that cannot in any simple way be transmitted to other
-- partitions.
elsif Is_Access_Type (T) then
Error_Msg_N
("access type variables " &
"not supported in Shared_Passive partitions",
Id);
-- We cannot tolerate types that contain access types, same reasons
elsif Contains_Access_Type (T) then
Error_Msg_N
("types containing access components " &
"not supported in Shared_Passive partitions",
Id);
-- Currently we do not support unconstrained record types, since we
-- use 'Write to write out values. This could probably be special
-- cased and handled in the future if necessary.
elsif Is_Record_Type (T)
and then not Is_Constrained (T)
then
Error_Msg_N
("unconstrained variant records " &
"not supported in Shared_Passive partitions",
Id);
end if;
end Check_Shared_Var;
--------------------------
-- Contains_Access_Type --
--------------------------
function Contains_Access_Type (T : Entity_Id) return Boolean is
C : Entity_Id;
begin
if Is_Access_Type (T) then
return True;
elsif Is_Array_Type (T) then
return Contains_Access_Type (Component_Type (T));
elsif Is_Record_Type (T) then
if Has_Discriminants (T) then
C := First_Discriminant (T);
while Present (C) loop
if Comes_From_Source (C) then
return True;
else
C := Next_Discriminant (C);
end if;
end loop;
end if;
C := First_Component (T);
while Present (C) loop
-- For components, ignore internal components other than _Parent
if Comes_From_Source (T)
and then
(Chars (C) = Name_uParent
or else
not Is_Internal_Name (Chars (C)))
and then Contains_Access_Type (Etype (C))
then
return True;
else
C := Next_Component (C);
end if;
end loop;
return False;
elsif Is_Protected_Type (T) then
return Contains_Access_Type (Corresponding_Record_Type (T));
else
return False;
end if;
end Contains_Access_Type;
end Sem_Smem;
|
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.RegExp --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.12 $
-- Binding Version 01.00
------------------------------------------------------------------------------
package Terminal_Interface.Curses.Forms.Field_Types.RegExp is
pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.RegExp);
type String_Access is access String;
type Regular_Expression_Field is new Field_Type with
record
Regular_Expression : String_Access;
end record;
procedure Set_Field_Type (Fld : Field;
Typ : Regular_Expression_Field);
pragma Inline (Set_Field_Type);
end Terminal_Interface.Curses.Forms.Field_Types.RegExp;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- SQL Database Access --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2014, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with League.Calendars.ISO_8601;
with League.Strings.Internals;
with Matreshka.Internals.Utf16;
with Matreshka.Internals.Strings.C;
with Matreshka.Internals.SQL_Drivers.Oracle.Plug_In;
package body Matreshka.Internals.SQL_Drivers.Oracle.Queries is
use type Interfaces.Unsigned_32;
use type Interfaces.Unsigned_16;
use type Interfaces.Integer_8;
use type Sb2;
use type SQL.Parameter_Directions;
use type Plug_In.Control_Side;
use type System.Storage_Elements.Storage_Count;
procedure Free is
new Ada.Unchecked_Deallocation (Bound_Value_Node, Bound_Value_Access);
procedure Free is
new Ada.Unchecked_Deallocation
(Defined_Value_Array, Defined_Value_Array_Access);
procedure Free is
new Ada.Unchecked_Deallocation
(System.Storage_Elements.Storage_Array, Storage_Array_Access);
type Utf16_Code_Unit_Access is
access all Matreshka.Internals.Utf16.Utf16_Code_Unit;
function OCICallbackInBind
(ictxp : Bound_Value_Access;
bindp : Oracle.Bind;
iter : Ub4;
index : Ub4;
bufpp : access Utf16_Code_Unit_Access;
alenp : access Ub4;
piecep : access Ub1;
indp : access Sb2_Ptr)
return Error_Code;
pragma Convention (C, OCICallbackInBind);
function OCICallbackOutBind
(octxp : Bound_Value_Access;
bindp : Oracle.Bind;
iter : Ub4;
index : Ub4;
bufpp : access Utf16_Code_Unit_Access;
alenp : access Ub4_Ptr;
piecep : access Ub1;
indp : access Sb2_Ptr;
rcodepp : access Sb2_Ptr)
return Error_Code;
pragma Convention (C, OCICallbackOutBind);
function "+"
(Left : Matreshka.Internals.Utf16.Utf16_String_Index;
Right : Ub4) return Matreshka.Internals.Utf16.Utf16_String_Index;
UTC_TZ : constant Wide_String := "+00:00";
---------
-- "+" --
---------
function "+"
(Left : Matreshka.Internals.Utf16.Utf16_String_Index;
Right : Ub4) return Matreshka.Internals.Utf16.Utf16_String_Index
is
use type Matreshka.Internals.Utf16.Utf16_String_Index;
begin
return Left + Matreshka.Internals.Utf16.Utf16_String_Index (Right) / 2;
end "+";
----------------
-- Bind_Value --
----------------
overriding procedure Bind_Value
(Self : not null access OCI_Query;
Name : League.Strings.Universal_String;
Value : League.Holders.Holder;
Direction : SQL.Parameter_Directions)
is
Code : Error_Code;
Pos : Parameter_Maps.Cursor;
Ok : Boolean;
procedure Bind
(Name : League.Strings.Universal_String;
Item : in out Bound_Value_Access);
----------
-- Bind --
----------
procedure Bind
(Name : League.Strings.Universal_String;
Item : in out Bound_Value_Access)
is
Length : Ub4;
Plugin : Plug_In_Access := Plug_In_Access (Self.DB.Plugins);
Control : Plug_In.Control_Side := Plug_In.Driver;
Extra_Type : Data_Type;
Extra_Size : System.Storage_Elements.Storage_Count := 0;
begin
while Plugin /= null loop
Plugin.Check_Parameter
(Value,
Control,
Extra_Type,
Extra_Size);
exit when Control = Plug_In.Plug_In;
Plugin := Plugin.Next;
end loop;
if Item /= null and then Item.Length < Extra_Size then
Free (Item);
end if;
if Item = null then
Item := new Bound_Value_Node (Extra_Size);
end if;
Item.Value := Value;
Item.Direction := Direction;
Item.Plugin := Plugin;
Item.Extra_Type := Extra_Type;
Item.Extra_Size := Extra_Size;
if Item.Plugin /= null then
Code :=
OCIBindByName
(Self.Handle,
Item.Bind'Access,
Self.DB.Error,
League.Strings.Internals.Internal (Name).Value,
Ub4 (League.Strings.Internals.Internal (Name).Unused) * 2,
Item.Extra (1)'Address,
Ub4 (Item.Extra_Size),
Item.Extra_Type,
Item.Is_Null'Access);
if Databases.Check_Error (Self.DB, Code) then
Free (Item);
return; -- How to report errors?
end if;
Item.Plugin.Encode (Value, Item.Extra (1 .. Item.Extra_Size));
elsif League.Holders.Is_Universal_String (Value) then
Length := 64 * 1024; -- 64kbyte max length of out string param
if Direction = SQL.In_Parameter then
if League.Holders.Is_Empty (Value) then
Length := 2;
else
Length :=
Ub4
(League.Strings.Internals.Internal
(League.Holders.Element (Value)).Unused) * 2 + 2;
end if;
end if;
Code :=
OCIBindByName
(Self.Handle,
Item.Bind'Access,
Self.DB.Error,
League.Strings.Internals.Internal (Name).Value,
Ub4 (League.Strings.Internals.Internal (Name).Unused) * 2,
Value_Length => Length,
Value_Type => SQLT_STR,
Mode => OCI_DATA_AT_EXEC);
if Databases.Check_Error (Self.DB, Code) then
Free (Item);
return; -- How to report errors?
end if;
Code :=
OCIBindDynamic
(Item.Bind,
Self.DB.Error,
Item.all'Address,
OCICallbackInBind'Address,
Item.all'Address,
OCICallbackOutBind'Address);
Item.String_Size := 0;
elsif League.Holders.Is_Abstract_Integer (Value) then
Code :=
OCIBindByName
(Self.Handle,
Item.Bind'Access,
Self.DB.Error,
League.Strings.Internals.Internal (Name).Value,
Ub4 (League.Strings.Internals.Internal (Name).Unused) * 2,
Item.Int'Address,
Item.Int'Size / 8,
SQLT_INT,
Item.Is_Null'Access);
if not League.Holders.Is_Empty (Value) then
Item.Int := League.Holders.Element (Value);
end if;
elsif League.Holders.Is_Abstract_Float (Value) then
Code :=
OCIBindByName
(Self.Handle,
Item.Bind'Access,
Self.DB.Error,
League.Strings.Internals.Internal (Name).Value,
Ub4 (League.Strings.Internals.Internal (Name).Unused) * 2,
Item.Float'Address,
Item.Float'Size / 8,
SQLT_FLT,
Item.Is_Null'Access);
if not League.Holders.Is_Empty (Value) then
Item.Float := League.Holders.Element (Value);
end if;
elsif League.Holders.Is_Date (Value) then
declare
Aux : League.Calendars.Date;
begin
Code :=
OCIBindByName
(Self.Handle,
Item.Bind'Access,
Self.DB.Error,
League.Strings.Internals.Internal (Name).Value,
Ub4 (League.Strings.Internals.Internal (Name).Unused) * 2,
Item.Date'Address,
Item.Date'Size / 8,
SQLT_ODT,
Item.Is_Null'Access);
if not League.Holders.Is_Empty (Value) then
Aux := League.Holders.Element (Value);
Item.Date := Utils.Encode_Date (Aux);
end if;
end;
elsif League.Holders.Is_Date_Time (Value) then
if Item.Timestamp = null then
Code := OCIDescriptorAlloc
(Databases.Env,
Item.Timestamp'Access,
OCI_DTYPE_TIMESTAMP_TZ);
end if;
Code :=
OCIBindByName
(Self.Handle,
Item.Bind'Access,
Self.DB.Error,
League.Strings.Internals.Internal (Name).Value,
Ub4 (League.Strings.Internals.Internal (Name).Unused) * 2,
Item.Timestamp'Address,
Item.Timestamp'Size / 8,
SQLT_TIMESTAMP_TZ,
Item.Is_Null'Access);
if not League.Holders.Is_Empty (Value) then
declare
use type Size_T;
Aux : constant League.Calendars.Date_Time :=
League.Holders.Element (Value);
Year : League.Calendars.ISO_8601.Year_Number;
Month : League.Calendars.ISO_8601.Month_Number;
Day : League.Calendars.ISO_8601.Day_Number;
Hour : League.Calendars.ISO_8601.Hour_Number;
Minute : League.Calendars.ISO_8601.Minute_Number;
Second : League.Calendars.ISO_8601.Second_Number;
Fraction : League.Calendars.ISO_8601.Nanosecond_100_Number;
begin
League.Calendars.ISO_8601.Split
(Aux, Year, Month, Day, Hour, Minute, Second, Fraction);
Code := OCIDateTimeConstruct
(Env => Databases.Env,
Error => Self.DB.Error,
Date => Item.Timestamp,
Year => Sb2 (Year),
Month => Ub1 (Month),
Day => Ub1 (Day),
Hour => Ub1 (Hour),
Min => Ub1 (Minute),
Sec => Ub1 (Second),
Fract => Ub4 (Fraction) * 100,
TZ => UTC_TZ (UTC_TZ'First)'Address,
TZ_Len => UTC_TZ'Length * 2);
end;
end if;
elsif League.Holders.Is_Empty (Value) then
Code :=
OCIBindByName
(Self.Handle,
Item.Bind'Access,
Self.DB.Error,
League.Strings.Internals.Internal (Name).Value,
Ub4 (League.Strings.Internals.Internal (Name).Unused) * 2,
Item.Int'Address,
Item.Int'Size / 8,
SQLT_INT,
Item.Is_Null'Access);
else
Free (Item);
return;
end if;
if Databases.Check_Error (Self.DB, Code) then
Free (Item);
return; -- How to report errors?
end if;
Item.Is_Null := -Boolean'Pos
(League.Holders.Is_Empty (Value) or Direction = SQL.Out_Parameter);
end Bind;
begin
if Self.State = Prepared then
Self.Parameters.Insert (Name, null, Pos, Ok);
Self.Parameters.Update_Element (Pos, Bind'Access);
end if;
end Bind_Value;
-----------------
-- Bound_Value --
-----------------
overriding function Bound_Value
(Self : not null access OCI_Query;
Name : League.Strings.Universal_String)
return League.Holders.Holder
is
Empty : League.Holders.Holder;
Pos : constant Parameter_Maps.Cursor := Self.Parameters.Find (Name);
Item : Bound_Value_Access;
begin
if Parameter_Maps.Has_Element (Pos) then
Item := Parameter_Maps.Element (Pos);
end if;
if Item = null then
return Empty;
else
return Item.Value;
end if;
end Bound_Value;
-------------------
-- Error_Message --
-------------------
overriding function Error_Message
(Self : not null access OCI_Query)
return League.Strings.Universal_String is
begin
return Self.DB.Error_Message;
end Error_Message;
-------------
-- Execute --
-------------
overriding function Execute
(Self : not null access OCI_Query) return Boolean
is
procedure Fixup_Parameter (Position : Parameter_Maps.Cursor);
---------------------
-- Fixup_Parameter --
---------------------
procedure Fixup_Parameter (Position : Parameter_Maps.Cursor) is
use type Matreshka.Internals.Strings.Shared_String_Access;
Ok : Boolean;
Item : constant Bound_Value_Access :=
Parameter_Maps.Element (Position);
begin
if Item = null or else Item.Direction = SQL.In_Parameter then
return;
elsif Item.String /= null then
Item.String.Unused := Item.String.Unused + Item.String_Size;
Matreshka.Internals.Strings.C.Validate_And_Fixup
(Item.String, Item.String.Unused, Ok);
League.Holders.Replace_Element
(Item.Value,
League.Strings.Internals.Wrap (Item.String));
Item.String := null;
Item.String_Size := 0;
if Item.Is_Null = -1 then
League.Holders.Clear (Item.Value);
end if;
elsif League.Holders.Is_Abstract_Integer (Item.Value) then
if Item.Is_Null = 0 then
League.Holders.Replace_Element (Item.Value, Item.Int);
else
League.Holders.Clear (Item.Value);
end if;
elsif League.Holders.Is_Abstract_Float (Item.Value) then
if Item.Is_Null = 0 then
League.Holders.Replace_Element (Item.Value, Item.Float);
else
League.Holders.Clear (Item.Value);
end if;
elsif Item.Is_Null /= 0 then
League.Holders.Clear (Item.Value);
end if;
end Fixup_Parameter;
Count : aliased Ub4;
Code : Error_Code;
begin -- Execute
if Self.State not in Ready then
return False;
end if;
Code :=
OCIStmtExecute
(Self.DB.Service,
Self.Handle,
Self.DB.Error,
Iters => Boolean'Pos (not Self.Is_Select));
if Databases.Check_Error (Self.DB, Code) then
return False;
end if;
Self.Parameters.Iterate (Fixup_Parameter'Access);
if Self.Is_Select and not Self.Is_Described then
Self.Is_Described := True;
Self.Column_Count := 0;
Code :=
OCIAttrGet
(Target => Self.Handle,
Target_Type => OCI_HTYPE_STMT,
Buffer => Count'Address,
Length => null,
Attr => OCI_ATTR_PARAM_COUNT,
Error => Self.DB.Error);
if Databases.Check_Error (Self.DB, Code) then
return False;
end if;
if Self.Columns /= null and then Self.Columns'Length < Count then
Free (Self.Columns);
end if;
if Self.Columns = null and Count > 0 then
Self.Columns := new Defined_Value_Array (1 .. Positive (Count));
end if;
for J in 1 .. Natural (Count) loop
declare
Param : aliased Parameter;
Column : Plug_In.Column_Description;
Plugin : Plug_In_Access := Plug_In_Access (Self.DB.Plugins);
Control : Plug_In.Control_Side := Plug_In.Driver;
begin
Code :=
OCIParamGet
(Self.Handle,
OCI_HTYPE_STMT,
Self.DB.Error,
Param'Access,
Ub4 (J));
if Databases.Check_Error (Self.DB, Code) then
return False;
end if;
Code :=
OCIAttrGet
(Param,
OCI_DTYPE_PARAM,
Column.Column_Type'Address,
null,
OCI_ATTR_DATA_TYPE,
Self.DB.Error);
if Databases.Check_Error (Self.DB, Code) then
return False;
end if;
Code :=
OCIAttrGet
(Param,
OCI_DTYPE_PARAM,
Column.Size'Address,
null,
OCI_ATTR_DATA_SIZE,
Self.DB.Error);
if Databases.Check_Error (Self.DB, Code) then
return False;
end if;
Code :=
OCIAttrGet
(Param,
OCI_DTYPE_PARAM,
Column.Precision'Address,
null,
OCI_ATTR_PRECISION,
Self.DB.Error);
if Databases.Check_Error (Self.DB, Code) then
return False;
end if;
Code :=
OCIAttrGet
(Param,
OCI_DTYPE_PARAM,
Column.Scale'Address,
null,
OCI_ATTR_SCALE,
Self.DB.Error);
if Databases.Check_Error (Self.DB, Code) then
return False;
end if;
-- Look for plugin
while Plugin /= null loop
Plugin.Check_Column
(Column,
Control,
Self.Columns (J).Extra_Type,
Self.Columns (J).Extra_Size);
exit when Control = Plug_In.Plug_In;
Plugin := Plugin.Next;
end loop;
Self.Columns (J).Plugin := Plugin;
if Plugin /= null then
-- Drop insufficient Extra space
if Self.Columns (J).Extra /= null and then
Self.Columns (J).Extra'Length < Self.Columns (J).Extra_Size
then
Free (Self.Columns (J).Extra);
end if;
-- Allocate Extra space
if Self.Columns (J).Extra = null then
Self.Columns (J).Extra := new
System.Storage_Elements.Storage_Array
(1 .. Self.Columns (J).Extra_Size);
end if;
Code :=
OCIDefineByPos
(Stmt => Self.Handle,
Target => Self.Columns (J).Define'Access,
Error => Self.DB.Error,
Position => Ub4 (J),
Value => Self.Columns (J).Extra (1)'Address,
Value_Length => Ub4 (Self.Columns (J).Extra_Size),
Value_Type => Self.Columns (J).Extra_Type,
Indicator => Self.Columns (J).Is_Null'Access);
if Databases.Check_Error (Self.DB, Code) then
return False;
end if;
elsif Column.Column_Type in SQLT_CHR | SQLT_AFC then
Self.Columns (J).Column_Type := String_Column;
Self.Columns (J).Size :=
Utf16.Utf16_String_Index (Column.Size + 1);
declare
use Matreshka.Internals.Strings;
Ptr : Shared_String_Access
renames Self.Columns (J).String;
begin
if Ptr = null then
Ptr := Allocate (Self.Columns (J).Size);
elsif not Can_Be_Reused (Ptr, Self.Columns (J).Size) then
Dereference (Ptr);
Ptr := Allocate (Self.Columns (J).Size);
end if;
Code :=
OCIDefineByPos
(Stmt => Self.Handle,
Target => Self.Columns (J).Define'Access,
Error => Self.DB.Error,
Position => Ub4 (J),
Value => Ptr.Value (0)'Address,
Value_Length => Ptr.Value'Length * 2,
Value_Type => SQLT_STR,
Indicator => Self.Columns (J).Is_Null'Access);
if Databases.Check_Error (Self.DB, Code) then
return False;
end if;
end;
elsif Column.Column_Type in
SQLT_NUM | SQLT_IBFLOAT | SQLT_IBDOUBLE
then
if Column.Column_Type = SQLT_NUM and Column.Scale = 0 then
Self.Columns (J).Column_Type := Integer_Column;
Code :=
OCIDefineByPos
(Stmt => Self.Handle,
Target => Self.Columns (J).Define'Access,
Error => Self.DB.Error,
Position => Ub4 (J),
Value => Self.Columns (J).Int'Address,
Value_Length => Self.Columns (J).Int'Size / 8,
Value_Type => SQLT_INT,
Indicator => Self.Columns (J).Is_Null'Access);
if Databases.Check_Error (Self.DB, Code) then
return False;
end if;
else
Self.Columns (J).Column_Type := Float_Column;
Code :=
OCIDefineByPos
(Stmt => Self.Handle,
Target => Self.Columns (J).Define'Access,
Error => Self.DB.Error,
Position => Ub4 (J),
Value => Self.Columns (J).Float'Address,
Value_Length => Self.Columns (J).Float'Size / 8,
Value_Type => SQLT_FLT,
Indicator => Self.Columns (J).Is_Null'Access);
if Databases.Check_Error (Self.DB, Code) then
return False;
end if;
end if;
elsif Column.Column_Type in SQLT_DAT then
Self.Columns (J).Column_Type := Date_Column;
Code :=
OCIDefineByPos
(Stmt => Self.Handle,
Target => Self.Columns (J).Define'Access,
Error => Self.DB.Error,
Position => Ub4 (J),
Value => Self.Columns (J).Date'Address,
Value_Length => Self.Columns (J).Date'Size / 8,
Value_Type => SQLT_ODT,
Indicator => Self.Columns (J).Is_Null'Access);
if Databases.Check_Error (Self.DB, Code) then
return False;
end if;
elsif Column.Column_Type in
SQLT_TIMESTAMP | SQLT_TIMESTAMP_TZ | SQLT_TIMESTAMP_LTZ
then
if Self.Columns (J).Timestamp = null then
Code := OCIDescriptorAlloc
(Databases.Env,
Self.Columns (J).Timestamp'Access,
OCI_DTYPE_TIMESTAMP_TZ);
end if;
Self.Columns (J).Column_Type := Time_Column;
Code :=
OCIDefineByPos
(Stmt => Self.Handle,
Target => Self.Columns (J).Define'Access,
Error => Self.DB.Error,
Position => Ub4 (J),
Value => Self.Columns (J).Timestamp'Address,
Value_Length => Self.Columns (J).Timestamp'Size / 8,
Value_Type => SQLT_TIMESTAMP_TZ,
Indicator => Self.Columns (J).Is_Null'Access);
if Databases.Check_Error (Self.DB, Code) then
return False;
end if;
else
exit;
-- raise Constraint_Error with "Unsupported type";
end if;
Code := OCIDescriptorFree (Param, OCI_DTYPE_PARAM);
if Databases.Check_Error (Self.DB, Code) then
return False;
end if;
end;
Self.Column_Count := J;
end loop;
end if;
if Self.Is_Select then
Self.State := Executed;
else
Self.State := No_More_Rows;
end if;
return True;
end Execute;
------------
-- Finish --
------------
overriding procedure Finish (Self : not null access OCI_Query) is
Code : Error_Code;
begin
if Self.State in Active then
if Self.State in Fetching then
-- Cancel cursor by fetching no rows
Code := OCIStmtFetch2 (Self.Handle, Self.DB.Error, Rows => 0);
if Databases.Check_Error (Self.DB, Code) then
null; -- How to report errors?
end if;
end if;
Self.State := Prepared;
end if;
end Finish;
----------------
-- Invalidate --
----------------
overriding procedure Invalidate (Self : not null access OCI_Query) is
procedure Drop (Pos : Parameter_Maps.Cursor);
----------
-- Drop --
----------
procedure Drop (Pos : Parameter_Maps.Cursor) is
Code : Error_Code;
Item : Bound_Value_Access := Parameter_Maps.Element (Pos);
begin
if Item /= null and then Item.Timestamp /= null then
Code := OCIHandleFree
(Item.Timestamp, OCI_DTYPE_TIMESTAMP_TZ);
if Databases.Check_Error (Self.DB, Code) then
null; -- How to report errors?
end if;
Item.Timestamp := null;
end if;
Free (Item);
Self.Parameters.Replace_Element (Pos, null);
end Drop;
Code : Error_Code;
begin
if Self.Handle /= null then
Code := OCIHandleFree (Self.Handle, OCI_HTYPE_STMT);
if Databases.Check_Error (Self.DB, Code) then
null; -- How to report errors?
end if;
Self.Handle := null;
end if;
Self.Parameters.Iterate (Drop'Access);
if Self.Columns /= null then
declare
use Matreshka.Internals.Strings;
begin
for J in Self.Columns'Range loop
if Self.Columns (J).String /= null then
Dereference (Self.Columns (J).String);
elsif Self.Columns (J).Timestamp /= null then
Code := OCIHandleFree
(Self.Columns (J).Timestamp, OCI_DTYPE_TIMESTAMP_TZ);
Self.Columns (J).Timestamp := null;
end if;
end loop;
Free (Self.Columns);
end;
end if;
-- Call Invalidate of parent tagged type.
Abstract_Query (Self.all).Invalidate;
end Invalidate;
---------------
-- Is_Active --
---------------
overriding function Is_Active
(Self : not null access OCI_Query) return Boolean is
begin
return Self.State in Active;
end Is_Active;
--------------
-- Is_Valid --
--------------
overriding function Is_Valid
(Self : not null access OCI_Query) return Boolean is
begin
return Self.State = Has_Row;
end Is_Valid;
----------
-- Next --
----------
overriding function Next
(Self : not null access OCI_Query) return Boolean
is
use Matreshka.Internals.Strings;
Ok : Boolean;
Code : Error_Code;
begin
if Self.State not in Fetching then
return False;
end if;
-- Rebind used strings columns
for J in 1 .. Self.Column_Count loop
if Self.Columns (J).Plugin = null
and then Self.Columns (J).Column_Type = String_Column
and then not Can_Be_Reused
(Self.Columns (J).String, Self.Columns (J).Size)
then
Dereference (Self.Columns (J).String);
Self.Columns (J).String := Allocate (Self.Columns (J).Size);
Code :=
OCIDefineByPos
(Stmt => Self.Handle,
Target => Self.Columns (J).Define'Access,
Error => Self.DB.Error,
Position => Ub4 (J),
Value => Self.Columns (J).String.Value (0)'Address,
Value_Length => Self.Columns (J).String.Value'Length * 2,
Value_Type => SQLT_STR,
Indicator => Self.Columns (J).Is_Null'Access);
if Databases.Check_Error (Self.DB, Code) then
Self.State := No_More_Rows;
return False;
end if;
end if;
end loop;
Code := OCIStmtFetch2 (Self.Handle, Self.DB.Error);
if Code = OCI_NO_DATA or else Databases.Check_Error (Self.DB, Code) then
Self.State := No_More_Rows;
else
Self.State := Has_Row;
-- validate not null string columns
for J in 1 .. Self.Column_Count loop
if Self.Columns (J).Column_Type = String_Column
and Self.Columns (J).Is_Null = 0
then
Matreshka.Internals.Strings.C.Validate_And_Fixup
(Self.Columns (J).String, Ok);
end if;
end loop;
end if;
return Self.State = Has_Row;
end Next;
-----------------------
-- OCICallbackInBind --
-----------------------
function OCICallbackInBind
(ictxp : Bound_Value_Access;
bindp : Oracle.Bind;
iter : Ub4;
index : Ub4;
bufpp : access Utf16_Code_Unit_Access;
alenp : access Ub4;
piecep : access Ub1;
indp : access Sb2_Ptr)
return Error_Code
is
pragma Unreferenced (bindp);
pragma Unreferenced (iter);
pragma Unreferenced (index);
begin
piecep.all := OCI_ONE_PIECE;
indp.all := ictxp.Is_Null'Access;
if ictxp.Is_Null = -1 then
bufpp.all := null;
alenp.all := 0;
return OCI_CONTINUE;
end if;
alenp.all :=
Ub4
(League.Strings.Internals.Internal
(League.Holders.Element (ictxp.Value)).Unused) * 2 + 2;
bufpp.all := League.Strings.Internals.Internal
(League.Holders.Element (ictxp.Value)).Value (0)'Access;
return OCI_CONTINUE;
end OCICallbackInBind;
------------------------
-- OCICallbackOutBind --
------------------------
function OCICallbackOutBind
(octxp : Bound_Value_Access;
bindp : Oracle.Bind;
iter : Ub4;
index : Ub4;
bufpp : access Utf16_Code_Unit_Access;
alenp : access Ub4_Ptr;
piecep : access Ub1;
indp : access Sb2_Ptr;
rcodepp : access Sb2_Ptr)
return Error_Code
is
pragma Unreferenced (bindp);
pragma Unreferenced (iter);
pragma Unreferenced (index);
pragma Unreferenced (Rcodepp);
use Matreshka.Internals.Strings;
use type Ub1;
use type Matreshka.Internals.Utf16.Utf16_String_Index;
begin
if piecep.all = OCI_ONE_PIECE then
piecep.all := OCI_FIRST_PIECE;
if not League.Holders.Is_Empty (octxp.Value) then
octxp.String := League.Strings.Internals.Internal
(League.Holders.Element (octxp.Value));
else
octxp.String := null;
end if;
if octxp.String /= null
and then Can_Be_Reused (octxp.String, octxp.String.Capacity - 1)
then
Reference (octxp.String);
League.Holders.Replace_Element
(octxp.Value, League.Strings.Empty_Universal_String);
else
octxp.String := Allocate (64); -- Some initial size
end if;
octxp.String.Unused := 0;
else
piecep.all := OCI_NEXT_PIECE;
octxp.String.Unused := octxp.String.Unused + octxp.String_Size;
Mutate (octxp.String, 8 * octxp.String.Capacity);
end if;
octxp.String_Size := Ub4
((octxp.String.Capacity - octxp.String.Unused) * 2);
bufpp.all := octxp.String.Value (octxp.String.Unused)'Access;
alenp.all := octxp.String_Size'Access;
indp.all := octxp.Is_Null'Access;
return OCI_CONTINUE;
end OCICallbackOutBind;
-------------
-- Prepare --
-------------
overriding function Prepare
(Self : not null access OCI_Query;
Query : League.Strings.Universal_String) return Boolean
is
Kind : aliased Ub2;
Code : Error_Code;
begin
if Self.Handle = null then
Code :=
OCIHandleAlloc (Databases.Env, Self.Handle'Access, OCI_HTYPE_STMT);
if Databases.Check_Error (Self.DB, Code) then
return False;
end if;
end if;
Code :=
OCIStmtPrepare
(Self.Handle,
Self.DB.Error,
League.Strings.Internals.Internal (Query).Value,
Ub4 (League.Strings.Internals.Internal (Query).Unused) * 2);
if Databases.Check_Error (Self.DB, Code) then
return False;
end if;
Code :=
OCIAttrGet
(Target => Self.Handle,
Target_Type => OCI_HTYPE_STMT,
Buffer => Kind'Address,
Length => null,
Attr => OCI_ATTR_STMT_TYPE,
Error => Self.DB.Error);
if Databases.Check_Error (Self.DB, Code) then
return False;
end if;
Self.Is_Described := False;
Self.Is_Select := Kind = OCI_STMT_SELECT;
Self.State := Prepared;
return True;
end Prepare;
-----------
-- Value --
-----------
overriding function Value
(Self : not null access OCI_Query;
Index : Positive) return League.Holders.Holder
is
Value : League.Holders.Holder;
begin
if Self.State /= Has_Row or else Index > Self.Column_Count then
return Value;
elsif Self.Columns (Index).Plugin /= null then
if Self.Columns (Index).Is_Null = 0 then
Self.Columns (Index).Plugin.Decode
(Value, Self.Columns (Index).Extra
(1 .. Self.Columns (Index).Extra_Size));
end if;
elsif Self.Columns (Index).Column_Type = String_Column then
League.Holders.Set_Tag (Value, League.Holders.Universal_String_Tag);
if Self.Columns (Index).Is_Null = 0 then
League.Holders.Replace_Element
(Value,
League.Strings.Internals.Create (Self.Columns (Index).String));
end if;
elsif Self.Columns (Index).Column_Type = Integer_Column then
League.Holders.Set_Tag (Value, League.Holders.Universal_Integer_Tag);
if Self.Columns (Index).Is_Null = 0 then
League.Holders.Replace_Element
(Value, Self.Columns (Index).Int);
end if;
elsif Self.Columns (Index).Column_Type = Float_Column then
League.Holders.Set_Tag (Value, League.Holders.Universal_Float_Tag);
if Self.Columns (Index).Is_Null = 0 then
League.Holders.Replace_Element (Value, Self.Columns (Index).Float);
end if;
elsif Self.Columns (Index).Column_Type = Date_Column then
League.Holders.Set_Tag (Value, League.Holders.Date_Tag);
if Self.Columns (Index).Is_Null = 0 then
League.Holders.Replace_Element
(Value, Utils.Decode_Date (Self.Columns (Index).Date));
end if;
elsif Self.Columns (Index).Column_Type = Time_Column then
League.Holders.Set_Tag (Value, League.Holders.Date_Time_Tag);
if Self.Columns (Index).Is_Null = 0 then
declare
Aux : League.Calendars.Date_Time;
Code : Error_Code;
Year : aliased Sb2;
Month : aliased Ub1;
Day : aliased Ub1;
Hour : aliased Ub1;
Min : aliased Ub1;
Sec : aliased Ub1;
Fract : aliased Ub4;
begin
Code :=
OCIDateTimeGetDate
(Env => Databases.Env,
Error => Self.DB.Error,
Date => Self.Columns (Index).Timestamp,
Year => Year'Access,
Month => Month'Access,
Day => Day'Access);
if Databases.Check_Error (Self.DB, Code) then
return Value;
end if;
Code :=
OCIDateTimeGetTime
(Env => Databases.Env,
Error => Self.DB.Error,
Date => Self.Columns (Index).Timestamp,
Hour => Hour'Access,
Min => Min'Access,
Sec => Sec'Access,
Fract => Fract'Access);
if Databases.Check_Error (Self.DB, Code) then
return Value;
end if;
Aux := League.Calendars.ISO_8601.Create
(League.Calendars.ISO_8601.Year_Number (Year),
League.Calendars.ISO_8601.Month_Number (Month),
League.Calendars.ISO_8601.Day_Number (Day),
League.Calendars.ISO_8601.Hour_Number (Hour),
League.Calendars.ISO_8601.Minute_Number (Min),
League.Calendars.ISO_8601.Second_Number (Sec),
League.Calendars.ISO_8601.Nanosecond_100_Number
(Fract / 100));
-- ??? where timezone should go???
League.Holders.Replace_Element (Value, Aux);
end;
end if;
end if;
return Value;
end Value;
end Matreshka.Internals.SQL_Drivers.Oracle.Queries;
|
$NetBSD: patch-gnatlib-gnat_src-mlib-utl.adb,v 1.1 2013/07/09 10:16:02 marino Exp $
Use unique ada executable rather than generic gcc
--- gnatlib/gnat_src/mlib-utl.adb.orig 2010-02-14 02:40:00.000000000 +0100
+++ gnatlib/gnat_src/mlib-utl.adb 2011-10-09 04:11:21.000000000 +0200
@@ -412,7 +412,7 @@
if Driver_Name = No_Name then
if Gcc_Exec = null then
if Gcc_Name = null then
- Gcc_Name := Osint.Program_Name ("gcc", "gnatmake");
+ Gcc_Name := Osint.Program_Name ("ada", "gnatmake");
end if;
Gcc_Exec := Locate_Exec_On_Path (Gcc_Name.all);
|
------------------------------------------------------------------------------
-- --
-- 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.Element_Collections;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.Utp_Attributes;
with AMF.UML.Behaviors;
with AMF.Utp.Test_Cases.Collections;
with AMF.Visitors.Utp_Iterators;
with AMF.Visitors.Utp_Visitors;
with League.Strings.Internals;
with Matreshka.Internals.Strings;
package body AMF.Internals.Utp_Test_Suites is
-----------------------
-- Get_Base_Behavior --
-----------------------
overriding function Get_Base_Behavior
(Self : not null access constant Utp_Test_Suite_Proxy)
return AMF.UML.Behaviors.UML_Behavior_Access is
begin
return
AMF.UML.Behaviors.UML_Behavior_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.Utp_Attributes.Internal_Get_Base_Behavior
(Self.Element)));
end Get_Base_Behavior;
-----------------------
-- Set_Base_Behavior --
-----------------------
overriding procedure Set_Base_Behavior
(Self : not null access Utp_Test_Suite_Proxy;
To : AMF.UML.Behaviors.UML_Behavior_Access) is
begin
AMF.Internals.Tables.Utp_Attributes.Internal_Set_Base_Behavior
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Base_Behavior;
-------------------
-- Get_Test_Case --
-------------------
overriding function Get_Test_Case
(Self : not null access constant Utp_Test_Suite_Proxy)
return AMF.Utp.Test_Cases.Collections.Set_Of_Utp_Test_Case is
begin
return
AMF.Utp.Test_Cases.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.Utp_Attributes.Internal_Get_Test_Case
(Self.Element)));
end Get_Test_Case;
------------------
-- Get_Priority --
------------------
overriding function Get_Priority
(Self : not null access constant Utp_Test_Suite_Proxy)
return AMF.Optional_String is
begin
declare
use type Matreshka.Internals.Strings.Shared_String_Access;
Aux : constant Matreshka.Internals.Strings.Shared_String_Access
:= AMF.Internals.Tables.Utp_Attributes.Internal_Get_Priority (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end;
end Get_Priority;
------------------
-- Set_Priority --
------------------
overriding procedure Set_Priority
(Self : not null access Utp_Test_Suite_Proxy;
To : AMF.Optional_String) is
begin
if To.Is_Empty then
AMF.Internals.Tables.Utp_Attributes.Internal_Set_Priority
(Self.Element, null);
else
AMF.Internals.Tables.Utp_Attributes.Internal_Set_Priority
(Self.Element,
League.Strings.Internals.Internal (To.Value));
end if;
end Set_Priority;
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant Utp_Test_Suite_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_Test_Suite
(AMF.Utp.Test_Suites.Utp_Test_Suite_Access (Self),
Control);
end if;
end Enter_Element;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant Utp_Test_Suite_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_Test_Suite
(AMF.Utp.Test_Suites.Utp_Test_Suite_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant Utp_Test_Suite_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_Test_Suite
(Visitor,
AMF.Utp.Test_Suites.Utp_Test_Suite_Access (Self),
Control);
end if;
end Visit_Element;
end AMF.Internals.Utp_Test_Suites;
|
-- { dg-do run }
-- { dg-options "-gnatws -gnatVa" }
pragma Initialize_Scalars;
procedure init_scalar1 is
type Fixed_3T is delta 2.0 ** (- 4)
range - 2.0 ** 19 .. (2.0 ** 19 - 2.0 ** (- 4));
for Fixed_3T'Size use 3*8;
Write_Value : constant Fixed_3T := Fixed_3T(524287.875);
type singleton is array (1 .. 1) of Fixed_3T;
pragma Pack (singleton);
it : Singleton;
begin
null;
end;
|
------------------------------------------------------------------------------
-- --
-- Ada binding for OpenGL/WebGL --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 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. --
-- --
------------------------------------------------------------------------------
with System;
with OpenGL.Contexts.Internals;
with GLEW; use GLEW;
with Interfaces.C;
package body OpenGL.Generic_Buffers is
use type GLFW.GLFWwindow_Access;
type GLuint_Access is access all GLuint with Convention => C;
Map : constant array (OpenGL.Buffer_Type) of OpenGL.GLenum :=
(OpenGL.Vertex => GLEW.ARRAY_BUFFER,
OpenGL.Index => GLEW.ELEMENT_ARRAY_BUFFER);
--------------
-- Allocate --
--------------
procedure Allocate
(Self : in out OpenGL_Buffer'Class; Data : Element_Array) is
use type Interfaces.C.ptrdiff_t;
begin
if Self.Context = null
or Self.Context /= OpenGL.Contexts.Internals.Current_GLFW_Context
then
-- Buffer was not created or created for another context.
return;
end if;
glBufferData
(Map (Self.Buffer_Type),
Data'Size / 8,
Data'Address,
STATIC_DRAW);
end Allocate;
----------
-- Bind --
----------
function Bind (Self : in out OpenGL_Buffer'Class) return Boolean is
begin
if Self.Context = null
or Self.Context /= OpenGL.Contexts.Internals.Current_GLFW_Context
then
-- Buffer was not created or created for another context.
return False;
end if;
glBindBuffer (Map (Self.Buffer_Type), Self.Buffer);
return True;
end Bind;
----------
-- Bind --
----------
procedure Bind (Self : in out OpenGL_Buffer'Class) is
begin
if not Self.Bind then
raise Program_Error;
end if;
end Bind;
------------
-- Create --
------------
function Create (Self : in out OpenGL_Buffer'Class) return Boolean is
use type Interfaces.C.unsigned;
begin
if Self.Context = null then
Self.Context := OpenGL.Contexts.Internals.Current_GLFW_Context;
if Self.Context = null then
return False;
end if;
end if;
if Self.Buffer = 0 then
glGenBuffers (1, Self.Buffer'Unchecked_Access);
if Self.Buffer = 0 then
Self.Context := null;
return False;
end if;
end if;
return True;
end Create;
------------
-- Create --
------------
procedure Create (Self : in out OpenGL_Buffer'Class) is
begin
if not Self.Create then
raise Program_Error;
end if;
end Create;
------------
-- Stride --
------------
function Stride return System.Storage_Elements.Storage_Count is
use type System.Storage_Elements.Storage_Offset;
begin
return Element_Array'Component_Size / System.Storage_Unit;
end Stride;
end OpenGL.Generic_Buffers;
|
-- Copyright 2009-2014 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
procedure Foo is
type Small is range -32 .. 31;
type SomePackedArray is array (Integer range <>) of Small;
pragma Pack (SomePackedArray);
type SomePackedRecord is record
Y: SomePackedArray (1 .. 10);
end record;
pragma Pack (SomePackedRecord);
Suite : SomePackedArray := (-1, -2, -3, -4, -5, -6, -7, -8, -9, -10);
XP: SomePackedRecord := (Y => Suite);
Slice : SomePackedArray renames XP.Y (3 .. 5);
begin
Slice (4) := 4; -- START
end Foo;
|
with SDL;
with SDL.Video.Windows;
with SDL.Video.Windows.Makers;
with SDL.Video.Surfaces;
with SDL.Video.Palettes; use SDL.Video.Palettes;
with SDL.Video.Pixels;
with SDL.Video.Pixel_Formats; use SDL.Video.Pixel_Formats;
with SDL.Video.Textures; use SDL.Video.Textures;
with SDL.Video.Textures.Makers;
with SDL.Video.Renderers;
with SDL.Video.Renderers.Makers;
use SDL.Video;
with Interfaces.C; use Interfaces.C;
with Ada.Unchecked_Conversion;
with System; use System;
package body SDL_Display is
W : SDL.Video.Windows.Window;
Renderer : SDL.Video.Renderers.Renderer;
Texture : SDL.Video.Textures.Texture;
SDL_Pixels : System.Address := System.Null_Address;
type Texture_1D_Array is array (Natural range <>)
of aliased SDL_Pixel;
procedure Lock is new SDL.Video.Textures.Lock
(Pixel_Pointer_Type => System.Address);
function Rendering return Boolean
is (SDL_Pixels /= System.Null_Address);
------------------
-- Start_Render --
------------------
procedure Start_Render is
begin
Lock (Texture, SDL_Pixels);
end Start_Render;
------------------------
-- Draw_Vertical_Line --
------------------------
procedure Draw_Vertical_Line
(X, Start_Y, Stop_Y : Integer;
C : SDL_Pixel)
is
Width : constant Natural := Texture.Get_Size.Width;
Height : constant Natural := Texture.Get_Size.Height;
Bounded_Start : constant Natural := (if Start_Y > 0 then Start_Y else 0);
begin
if X in 0 .. Width - 1 then
declare
Actual_Pixels : Texture_1D_Array (0 .. Natural (Width * Height - 1))
with
Address => SDL_Pixels;
begin
for Y in Bounded_Start .. Integer'Min (Stop_Y, Height - 1) loop
Actual_Pixels (X + Y * Natural (Width)) := C;
end loop;
end;
end if;
end Draw_Vertical_Line;
----------
-- Fill --
----------
procedure Fill (C : SDL_Pixel) is
Width : constant Natural := Texture.Get_Size.Width;
Height : constant Natural := Texture.Get_Size.Height;
begin
declare
Actual_Pixels : Texture_1D_Array (0 .. Natural (Width * Height - 1))
with
Address => SDL_Pixels;
begin
for Elt of Actual_Pixels loop
Elt := C;
end loop;
end;
end Fill;
----------------
-- End_Render --
----------------
procedure End_Render is
Width : constant Natural := Texture.Get_Size.Width;
Height : constant Natural := Texture.Get_Size.Height;
begin
Texture.Unlock;
SDL_Pixels := System.Null_Address;
Renderer.Clear;
Renderer.Copy (Texture, To => (0,
0,
int (Width),
int (Height)));
Renderer.Present;
end End_Render;
------------------
-- To_SDL_Color --
------------------
function To_SDL_Color (R, G, B : Unsigned_8) return SDL_Pixel is
RB : constant Unsigned_16 :=
Shift_Right (Unsigned_16 (R), 3) and 16#1F#;
GB : constant Unsigned_16 :=
Shift_Right (Unsigned_16 (G), 2) and 16#3F#;
BB : constant Unsigned_16 :=
Shift_Right (Unsigned_16 (B), 3) and 16#1F#;
begin
return (Shift_Left (RB, 11) or Shift_Left (GB, 5) or BB);
end To_SDL_Color;
----------------
-- Initialize --
----------------
procedure Initialize is
begin
if not SDL.Initialise (Flags => SDL.Enable_Screen) then
raise Program_Error with "SDL Video init failed";
end if;
SDL.Video.Windows.Makers.Create
(W, "Ada Voxel",
0,
0,
Screen_Width,
Screen_Height,
Flags => SDL.Video.Windows.Resizable);
SDL.Video.Renderers.Makers.Create (Renderer, W);
SDL.Video.Textures.Makers.Create
(Tex => Texture,
Renderer => Renderer,
Format => SDL.Video.Pixel_Formats.Pixel_Format_RGB_565,
Kind => SDL.Video.Textures.Streaming,
Size => (Screen_Width,
Screen_Height));
end Initialize;
begin
Initialize;
end SDL_Display;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2017-2020, 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: 5724 $ $Date: 2017-01-25 16:25:24 +0300 (Wed, 25 Jan 2017) $
------------------------------------------------------------------------------
package Web.UI.Slots is
pragma Preelaborate;
end Web.UI.Slots;
|
------------------------------------------------------------------------------
-- --
-- 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 --
-- --
-- S p e c --
-- --
-- Copyright (C) 2001-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. --
-- --
------------------------------------------------------------------------------
-- This is the version of this package for Ravenscar bare board targets
-- This package contains all the GNULL primitives that interface directly with
-- the underlying OS.
pragma Restrictions (No_Elaboration_Code);
with System.Multiprocessors;
with System.Parameters;
with System.Tasking;
with System.OS_Interface;
package System.Task_Primitives.Operations is
pragma Preelaborate;
package ST renames System.Tasking;
package OSI renames System.OS_Interface;
Environment_Task : ST.Task_Id := ST.Null_Task;
-- Task ID of the environment task
-- See s-taprop.ads for up to date specs of the following subprograms
procedure Initialize (Environment_Task : ST.Task_Id);
pragma Inline (Initialize);
-- Perform initialization and set up of the environment task for proper
-- operation of the tasking run-time. This must be called once, before any
-- other subprograms of this package are called.
procedure Create_Task
(T : ST.Task_Id;
Wrapper : System.Address;
Stack_Size : System.Parameters.Size_Type;
Priority : ST.Extended_Priority;
Base_CPU : System.Multiprocessors.CPU_Range;
Succeeded : out Boolean);
pragma Inline (Create_Task);
procedure Enter_Task (Self_ID : ST.Task_Id);
pragma Inline (Enter_Task);
procedure Initialize_TCB (Self_ID : ST.Task_Id; Succeeded : out Boolean);
pragma Inline (Initialize_TCB);
function Self return ST.Task_Id;
pragma Inline (Self);
procedure Set_Priority (T : ST.Task_Id; Prio : ST.Extended_Priority);
pragma Inline (Set_Priority);
function Get_Priority (T : ST.Task_Id) return ST.Extended_Priority;
pragma Inline (Get_Priority);
function Get_Affinity
(T : ST.Task_Id) return System.Multiprocessors.CPU_Range;
function Get_CPU (T : ST.Task_Id) return System.Multiprocessors.CPU;
function Get_Thread_Id (T : ST.Task_Id) return OSI.Thread_Id;
-- Return the thread id of the specified task
type Time is new System.OS_Interface.Time;
function Monotonic_Clock return Time;
pragma Inline (Monotonic_Clock);
----------------
-- Extensions --
----------------
procedure Sleep
(Self_ID : ST.Task_Id;
Reason : System.Tasking.Task_States);
pragma Inline (Sleep);
-- The caller should hold no lock when calling this procedure
procedure Delay_Until (Abs_Time : Time);
pragma Inline (Delay_Until);
procedure Wakeup
(T : ST.Task_Id;
Reason : System.Tasking.Task_States);
pragma Inline (Wakeup);
-- The caller should hold no lock when calling this procedure
function Is_Task_Context return Boolean;
pragma Inline (Is_Task_Context);
-- This function returns True if the current execution is in the context
-- of a task, and False if it is an interrupt context.
end System.Task_Primitives.Operations;
|
-- Copyright 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package Pck is
Procedure_Result : Character := ' ';
procedure Same (C : Character);
-- Set Procedure_Result to C.
procedure Next (C : in out Character);
-- Increment C (if C is the last character, then set C to the first
-- character). Set Procedure_Result to the new value of C.
end Pck;
|
-----------------------------------------------------------------------
-- css-core -- Core CSS API definition
-- Copyright (C) 2017 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Strings;
with Util.Refs;
with Util.Log.Locations;
private with CSS.Comments;
private with Ada.Finalization;
private with Ada.Strings.Unbounded;
private with Ada.Containers.Hashed_Maps;
-- The API implemented by the <tt>CSS.Core</tt> package and child packages try to
-- follow the IDL specification defined in the W3C CSS Object Model (CSSOM)
-- (See https://drafts.csswg.org/cssom/ or https://www.w3.org/TR/2016/WD-cssom-1-20160317/)
package CSS.Core is
type CSSProperty_Name is access all String;
subtype CSSProperty_Value is CSSProperty_Name;
subtype Location is Util.Log.Locations.Line_Info;
use type Util.Log.Locations.Line_Info;
-- Get the line number.
function Get_Line (Loc : in Location) return Natural renames Util.Log.Locations.Line;
-- Get a printable representation of the source file name and line number.
function To_String (Loc : in Location) return String;
-- The StyleSheet interface represents an abstract, base style sheet.
-- See CSSOM: 5.1.1. The StyleSheet Interface
type Stylesheet is tagged limited private;
type Stylesheet_Access is access all Stylesheet'Class;
-- Returns the CSS type ("text/css").
function Get_Type (Sheet : in Stylesheet) return String;
-- Get the parent CSS stylesheet if there is one or return null.
function Get_Parent (Sheet : in Stylesheet) return Stylesheet_Access;
-- Get the source file information.
function Get_File_Info (Sheet : in Stylesheet) return Util.Log.Locations.File_Info_Access;
-- Get the href attribute (stylesheet location).
function Get_Href (Sheet : in Stylesheet) return String;
-- Set the href attribute representing the stylesheet location.
procedure Set_Href (Sheet : in out Stylesheet;
Href : in String);
function Create_Property_Name (Sheet : in Stylesheet;
Name : in String) return CSSProperty_Name;
-- Create a location record to represent a CSS source position.
function Create_Location (Sheet : in Stylesheet_Access;
Line : in Natural;
Column : in Natural) return Location;
type CSSRule_Type is (STYLE_RULE, CHARSET_RULE, IMPORT_RULE, MEDIA_RULE,
FONT_FACE_RULE, PAGE_RULE, MARGIN_RULE, NAMESPACE_RULE);
-- The CSSRule interface represents an abstract, base CSS style rule.
-- Each distinct CSS style rule type is represented by a distinct interface that inherits
-- from this interface.
-- See CSSOM: Section 5.4.2. The CSSRule Interface
type CSSRule is abstract new Util.Refs.Ref_Entity with private;
type CSSRule_Access is access all CSSRule'Class;
-- Get the type that identifies the rule.
function Get_Type (Rule : in CSSRule) return CSSRule_Type is abstract;
-- Get the parent rule. Returns null when there is no parent.
function Get_Parent (Rule : in CSSRule) return CSSRule_Access;
-- Get the stylesheet.
function Get_Stylesheet (Rule : in CSSRule) return Stylesheet_Access;
-- Get the location of the rule.
function Get_Location (Rule : in CSSRule) return Location;
private
type String_Access is access all String;
package String_Map is new Ada.Containers.Hashed_Maps
(Key_Type => Util.Strings.Name_Access,
Element_Type => CSSProperty_Name,
Hash => Util.Strings.Hash,
Equivalent_Keys => Util.Strings.Equivalent_Keys);
type String_Map_Access is access all String_Map.Map;
type Stylesheet is new Ada.Finalization.Limited_Controlled with record
Loc : Location;
Parent : Stylesheet_Access;
File : Util.Log.Locations.File_Info_Access;
Href : Ada.Strings.Unbounded.Unbounded_String;
Strings : String_Map_Access := new String_Map.Map;
Comments : CSS.Comments.CSSComment_List;
end record;
overriding
procedure Finalize (Sheet : in out Stylesheet);
type CSSRule is abstract new Util.Refs.Ref_Entity with record
Loc : Location;
Sheet : Stylesheet_Access;
Parent : CSSRule_Access;
Comments : CSS.Comments.CSSComment_List;
end record;
-- Set the source code location.
procedure Set_Location (Rule : in out CSSRule'Class;
Line : in Natural;
Column : in Natural;
Sheet : in Stylesheet_Access);
end CSS.Core;
|
with GID.Buffering;
with Ada.Exceptions;
package body GID.Color_tables is
procedure Convert(c, d: in U8; rgb: out RGB_color) is
begin
rgb.red := (d and 127) / 4;
rgb.green:= (d and 3) * 8 + c / 32;
rgb.blue := c and 31;
--
rgb.red := U8((U16(rgb.red ) * 255) / 31);
rgb.green:= U8((U16(rgb.green) * 255) / 31);
rgb.blue := U8((U16(rgb.blue ) * 255) / 31);
end Convert;
procedure Load_palette (image: in out Image_descriptor) is
c, d: U8;
use GID.Buffering;
begin
if image.palette = null then
return;
end if;
declare
palette: Color_table renames image.palette.all;
begin
for i in palette'Range loop
case image.format is
when BMP =>
-- order is BGRx
U8'Read(image.stream, palette(i).blue);
U8'Read(image.stream, palette(i).green);
U8'Read(image.stream, palette(i).red);
U8'Read(image.stream, c);
-- x discarded
when GIF | PNG =>
-- buffered; order is RGB
Get_Byte(image.buffer, palette(i).red);
Get_Byte(image.buffer, palette(i).green);
Get_Byte(image.buffer, palette(i).blue);
when TGA =>
case image.subformat_id is -- = palette's bit depth
when 8 => -- Grey
U8'Read(image.stream, c);
palette(i).red := c;
palette(i).green:= c;
palette(i).blue := c;
when 15 | 16 => -- RGB, 5 bit per channel
U8'Read(image.stream, c);
U8'Read(image.stream, d);
Convert(c, d, palette(i));
when 24 | 32 => -- RGB | RGBA, 8 bit per channel
U8'Read(image.stream, palette(i).blue);
U8'Read(image.stream, palette(i).green);
U8'Read(image.stream, palette(i).red);
when others =>
null;
end case;
when others =>
Ada.Exceptions.Raise_Exception(
unsupported_image_subformat'Identity,
"Palette loading not implemented for " &
Image_format_type'Image(image.format)
);
end case;
end loop;
end;
end Load_palette;
end GID.Color_tables;
|
------------------------------------------------------------------------------
-- --
-- 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$
------------------------------------------------------------------------------
-- Interface of XMI document resolvers.
------------------------------------------------------------------------------
with XML.SAX.Input_Sources;
package AMF.XMI.Document_Resolvers is
pragma Preelaborate;
type XMI_Document_Resolver is limited interface;
type XMI_Document_Resolver_Access is access all XMI_Document_Resolver'Class;
not overriding function Error_String
(Self : XMI_Document_Resolver)
return League.Strings.Universal_String is abstract;
-- Returns error message for the last detected error.
not overriding procedure Resolve_Document
(Self : in out XMI_Document_Resolver;
URI : League.Strings.Universal_String;
Source : out XML.SAX.Input_Sources.SAX_Input_Source_Access;
Success : in out Boolean) is abstract;
-- Resolves document URI, opens and returns its input source.
end AMF.XMI.Document_Resolvers;
|
-- MIT License
-- Copyright (c) 2021 Stephen Merrony
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
with AOSVS.Agent.Tasking;
with Debug_Logs; use Debug_Logs;
with Memory; use Memory;
with PARU_32; use PARU_32;
package body AOSVS.Multitasking is
function Sys_IFPU (CPU : in out CPU_T) return Boolean is
begin
Loggers.Debug_Print (Sc_Log, "?IFPU");
-- STUB
return true;
end Sys_IFPU;
function Sys_KILAD (CPU : in out CPU_T; PID : in Word_T; Kill_Addr : out Phys_Addr_T) return Boolean is
begin
Loggers.Debug_Print (Sc_Log, "?KILAD");
Kill_Addr := Phys_Addr_T(RAM.Read_Dword(Phys_Addr_T(CPU.AC(0))));
return true;
end Sys_KILAD;
function Sys_REC (CPU : in out CPU_T; PID : in Word_T; TID : in Word_T) return Boolean is
begin
Loggers.Debug_Print (Sc_Log, "?REC");
raise Not_Yet_Implemented;
return true;
end Sys_REC;
function Sys_UIDSTAT (CPU : in out CPU_T; PID : in Word_T; TID : in Word_T) return Boolean is
Req_TID : Dword_T := CPU.AC(1);
Pkt_Addr : Phys_Addr_T := Phys_Addr_T(CPU.AC(2));
begin
Loggers.Debug_Print (Sc_Log, "?UIDSTAT");
Loggers.Debug_Print (Sc_Log, "-------- Returning UTID: " & Word_To_String(Agent.Tasking.Get_Unique_TID(PID_T(PID), TID), Decimal, 2) &
", STID: " & Word_To_String(TID, Decimal, 2));
if Req_TID /= 16#ffff_ffff# then
raise Not_Yet_Implemented with "?UIDSTAT for another TID";
end if;
RAM.Write_Word(Pkt_Addr + UUID, Agent.Tasking.Get_Unique_TID(PID_T(PID), TID));
RAM.Write_Word(Pkt_Addr + UTSTAT, 0);
RAM.Write_Word(Pkt_Addr + UTID, TID);
RAM.Write_Word(Pkt_Addr + UTPRI, 0);
return true;
end Sys_UIDSTAT;
function Sys_WDELAY (CPU : in out CPU_T; PID : in Word_T; TID : in Word_T) return Boolean is
Int_Delay : Integer := Integer(Dword_To_Integer_32(CPU.AC(0)));
Secs : Duration := Duration(0.001) * Int_Delay;
begin
Loggers.Debug_Print (Sc_Log, "?WDELAY");
delay Secs;
return true;
end Sys_WDELAY;
end AOSVS.Multitasking; |
with Ada.Text_IO; use Ada.Text_IO;
with Libadalang.Analysis; use Libadalang.Analysis;
with Libadalang.Common; use Libadalang.Common;
with Rejuvenation; use Rejuvenation;
with Rejuvenation.Factory; use Rejuvenation.Factory;
with Rejuvenation.Finder; use Rejuvenation.Finder;
with Rejuvenation.Navigation; use Rejuvenation.Navigation;
package body Examples.Navigation is
procedure Demo_Navigate_Node (Unit : Analysis_Unit);
procedure Demo (File_Name : String) is
Unit : constant Analysis_Unit := Open_File (File_Name);
begin
Put_Line ("=== Examples of Navigation =======");
New_Line;
Put_Line ("--- Example to navigate between nodes -------");
New_Line;
Demo_Navigate_Node (Unit);
New_Line;
end Demo;
procedure Demo_Navigate_Node (Unit : Analysis_Unit) is
Results_Node : constant Node_List.Vector :=
Find (Unit.Root, Ada_Call_Expr);
begin
for Node of Results_Node loop
declare
ObjNode : constant Ada_Node :=
Get_Ancestor_Of_Type (Node, Ada_Call_Stmt);
begin
if ObjNode /= No_Ada_Node then
Put_Line
("Call_Expr " & Node.Image & " inside Call_Stmt " &
ObjNode.Image);
end if;
end;
end loop;
end Demo_Navigate_Node;
end Examples.Navigation;
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="14">
<syndb class_id="0" tracking_level="0" version="0">
<userIPLatency>-1</userIPLatency>
<userIPName/>
<cdfg class_id="1" tracking_level="1" version="0" object_id="_0">
<name>call</name>
<ret_bitwidth>0</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="3" tracking_level="1" version="0" object_id="_1">
<Value class_id="4" tracking_level="0" version="0">
<Obj class_id="5" tracking_level="0" version="0">
<type>1</type>
<id>1</id>
<name>in_stream_V_value_V</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo class_id="6" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>in_stream.V.value.V</originalName>
<rtlName/>
<coreName>FIFO_SRL</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>3</if_type>
<array_size>0</array_size>
<bit_vecs class_id="7" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_2">
<Value>
<Obj>
<type>1</type>
<id>2</id>
<name>out_stream_V_value_V</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>out_stream.V.value.V</originalName>
<rtlName/>
<coreName>FIFO_SRL</coreName>
</Obj>
<bitwidth>288</bitwidth>
</Value>
<direction>1</direction>
<if_type>3</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
</ports>
<nodes class_id="8" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_3">
<Value>
<Obj>
<type>0</type>
<id>8</id>
<name>slice_stream_V_value</name>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>172</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="10" tracking_level="0" version="0">
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/conv2d</first>
<second class_id="11" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="12" tracking_level="0" version="0">
<first class_id="13" tracking_level="0" version="0">
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>172</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>slice_stream.V.value.V</originalName>
<rtlName>slice_stream_V_value_U</rtlName>
<coreName>FIFO_SRL</coreName>
</Obj>
<bitwidth>96</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>17</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_4">
<Value>
<Obj>
<type>0</type>
<id>12</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName>call_Loop_LB2D_buf_p_U0</rtlName>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>19</item>
<item>20</item>
<item>21</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_5">
<Value>
<Obj>
<type>0</type>
<id>13</id>
<name/>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName>call_Loop_LB2D_shift_U0</rtlName>
<coreName/>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>5</count>
<item_version>0</item_version>
<item>23</item>
<item>24</item>
<item>25</item>
<item>135</item>
<item>136</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_6">
<Value>
<Obj>
<type>0</type>
<id>14</id>
<name/>
<fileName>../../../lib_files/Linebuffer.h</fileName>
<fileDirectory>..</fileDirectory>
<lineNumber>219</lineNumber>
<contextFuncName>call</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/dhuff/Halide-HLS/apps/hls_examples/camera_ready_synthesis/app_files/big_apps_8_shifts/conv2d</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>../../../lib_files/Linebuffer.h</first>
<second>call</second>
</first>
<second>219</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>3</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_7">
<Value>
<Obj>
<type>2</type>
<id>16</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="_8">
<Value>
<Obj>
<type>2</type>
<id>18</id>
<name>call_Loop_LB2D_buf_p</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><constant:call_Loop_LB2D_buf_p></content>
</item>
<item class_id_reference="16" object_id="_9">
<Value>
<Obj>
<type>2</type>
<id>22</id>
<name>call_Loop_LB2D_shift</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><constant:call_Loop_LB2D_shift></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="_10">
<Obj>
<type>3</type>
<id>15</id>
<name>call</name>
<fileName/>
<fileDirectory/>
<lineNumber>0</lineNumber>
<contextFuncName/>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName/>
<rtlName/>
<coreName/>
</Obj>
<node_objs>
<count>4</count>
<item_version>0</item_version>
<item>8</item>
<item>12</item>
<item>13</item>
<item>14</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>9</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_11">
<id>17</id>
<edge_type>1</edge_type>
<source_obj>16</source_obj>
<sink_obj>8</sink_obj>
</item>
<item class_id_reference="20" object_id="_12">
<id>19</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>12</sink_obj>
</item>
<item class_id_reference="20" object_id="_13">
<id>20</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>12</sink_obj>
</item>
<item class_id_reference="20" object_id="_14">
<id>21</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>12</sink_obj>
</item>
<item class_id_reference="20" object_id="_15">
<id>23</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>13</sink_obj>
</item>
<item class_id_reference="20" object_id="_16">
<id>24</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>13</sink_obj>
</item>
<item class_id_reference="20" object_id="_17">
<id>25</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>13</sink_obj>
</item>
<item class_id_reference="20" object_id="_18">
<id>135</id>
<edge_type>4</edge_type>
<source_obj>12</source_obj>
<sink_obj>13</sink_obj>
</item>
<item class_id_reference="20" object_id="_19">
<id>136</id>
<edge_type>4</edge_type>
<source_obj>12</source_obj>
<sink_obj>13</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="_20">
<mId>1</mId>
<mTag>call</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>15</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>2077921</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>1</mIsDfPipe>
<mDfPipe class_id="23" tracking_level="1" version="0" object_id="_21">
<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>2</count>
<item_version>0</item_version>
<item class_id="26" tracking_level="1" version="0" object_id="_22">
<type>0</type>
<name>call_Loop_LB2D_buf_p_U0</name>
<ssdmobj_id>12</ssdmobj_id>
<pins class_id="27" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="28" tracking_level="1" version="0" object_id="_23">
<port class_id="29" tracking_level="1" version="0" object_id="_24">
<name>in_stream_V_value_V</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id="30" tracking_level="1" version="0" object_id="_25">
<type>0</type>
<name>call_Loop_LB2D_buf_p_U0</name>
<ssdmobj_id>12</ssdmobj_id>
</inst>
</item>
<item class_id_reference="28" object_id="_26">
<port class_id_reference="29" object_id="_27">
<name>slice_stream_V_value_V</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_25"/>
</item>
</pins>
</item>
<item class_id_reference="26" object_id="_28">
<type>0</type>
<name>call_Loop_LB2D_shift_U0</name>
<ssdmobj_id>13</ssdmobj_id>
<pins>
<count>2</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_29">
<port class_id_reference="29" object_id="_30">
<name>slice_stream_V_value_V</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id="_31">
<type>0</type>
<name>call_Loop_LB2D_shift_U0</name>
<ssdmobj_id>13</ssdmobj_id>
</inst>
</item>
<item class_id_reference="28" object_id="_32">
<port class_id_reference="29" object_id="_33">
<name>out_stream_V_value_V</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_31"/>
</item>
</pins>
</item>
</process_list>
<channel_list class_id="31" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="32" tracking_level="1" version="0" object_id="_34">
<type>1</type>
<name>slice_stream_V_value</name>
<ssdmobj_id>8</ssdmobj_id>
<ctype>0</ctype>
<depth>1</depth>
<bitwidth>96</bitwidth>
<source class_id_reference="28" object_id="_35">
<port class_id_reference="29" object_id="_36">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_25"/>
</source>
<sink class_id_reference="28" object_id="_37">
<port class_id_reference="29" object_id="_38">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_31"/>
</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="_39">
<states class_id="35" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="36" tracking_level="1" version="0" object_id="_40">
<id>1</id>
<operations class_id="37" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="38" tracking_level="1" version="0" object_id="_41">
<id>8</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_42">
<id>12</id>
<stage>2</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="36" object_id="_43">
<id>2</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="38" object_id="_44">
<id>12</id>
<stage>1</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="36" object_id="_45">
<id>3</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="38" object_id="_46">
<id>13</id>
<stage>2</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="36" object_id="_47">
<id>4</id>
<operations>
<count>10</count>
<item_version>0</item_version>
<item class_id_reference="38" object_id="_48">
<id>3</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_49">
<id>4</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_50">
<id>5</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_51">
<id>6</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_52">
<id>7</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_53">
<id>9</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_54">
<id>10</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_55">
<id>11</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_56">
<id>13</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="38" object_id="_57">
<id>14</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
</states>
<transitions class_id="39" tracking_level="0" version="0">
<count>3</count>
<item_version>0</item_version>
<item class_id="40" tracking_level="1" version="0" object_id="_58">
<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="_59">
<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="_60">
<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>
</transitions>
</fsm>
<res class_id="44" tracking_level="1" version="0" object_id="_61">
<dp_component_resource class_id="45" tracking_level="0" version="0">
<count>3</count>
<item_version>0</item_version>
<item class_id="46" tracking_level="0" version="0">
<first>call_Loop_LB2D_buf_p_U0 (call_Loop_LB2D_buf_p)</first>
<second class_id="47" tracking_level="0" version="0">
<count>3</count>
<item_version>0</item_version>
<item class_id="48" tracking_level="0" version="0">
<first>BRAM</first>
<second>8</second>
</item>
<item>
<first>FF</first>
<second>787</second>
</item>
<item>
<first>LUT</first>
<second>493</second>
</item>
</second>
</item>
<item>
<first>call_Loop_LB2D_shift_U0 (call_Loop_LB2D_shift)</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>
<first>FF</first>
<second>310</second>
</item>
<item>
<first>LUT</first>
<second>146</second>
</item>
</second>
</item>
<item>
<first>start_for_call_LodEe_U (start_for_call_LodEe)</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
</dp_component_resource>
<dp_expression_resource>
<count>2</count>
<item_version>0</item_version>
<item>
<first>ap_idle ( and ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
<item>
<first>call_Loop_LB2D_buf_p_U0_start_full_n ( or ) </first>
<second>
<count>4</count>
<item_version>0</item_version>
<item>
<first>(0P0)</first>
<second>1</second>
</item>
<item>
<first>(1P1)</first>
<second>1</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>2</second>
</item>
</second>
</item>
</dp_expression_resource>
<dp_fifo_resource>
<count>1</count>
<item_version>0</item_version>
<item>
<first>slice_stream_V_value_U</first>
<second>
<count>5</count>
<item_version>0</item_version>
<item>
<first>(0Depth)</first>
<second>1</second>
</item>
<item>
<first>(1Bits)</first>
<second>96</second>
</item>
<item>
<first>(2Size:D*B)</first>
<second>96</second>
</item>
<item>
<first>FF</first>
<second>0</second>
</item>
<item>
<first>LUT</first>
<second>1</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>0</count>
<item_version>0</item_version>
</dp_multiplexer_resource>
<dp_register_resource>
<count>0</count>
<item_version>0</item_version>
</dp_register_resource>
<dp_component_map class_id="49" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="50" tracking_level="0" version="0">
<first>call_Loop_LB2D_buf_p_U0 (call_Loop_LB2D_buf_p)</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
<item>
<first>call_Loop_LB2D_shift_U0 (call_Loop_LB2D_shift)</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
</dp_component_map>
<dp_expression_map>
<count>0</count>
<item_version>0</item_version>
</dp_expression_map>
<dp_fifo_map>
<count>1</count>
<item_version>0</item_version>
<item>
<first>slice_stream_V_value_U</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>43</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>4</count>
<item_version>0</item_version>
<item class_id="52" tracking_level="0" version="0">
<first>8</first>
<second class_id="53" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>12</first>
<second>
<first>0</first>
<second>1</second>
</second>
</item>
<item>
<first>13</first>
<second>
<first>2</first>
<second>1</second>
</second>
</item>
<item>
<first>14</first>
<second>
<first>3</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>15</first>
<second class_id="56" tracking_level="0" version="0">
<first>0</first>
<second>3</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="_62">
<region_name>call</region_name>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>15</item>
</basic_blocks>
<nodes>
<count>12</count>
<item_version>0</item_version>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
<item>10</item>
<item>11</item>
<item>12</item>
<item>13</item>
<item>14</item>
</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>3</count>
<item_version>0</item_version>
<item class_id="60" tracking_level="0" version="0">
<first>36</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>8</item>
</second>
</item>
<item>
<first>40</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>12</item>
<item>12</item>
</second>
</item>
<item>
<first>47</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>13</item>
<item>13</item>
</second>
</item>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="62" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="63" tracking_level="0" version="0">
<first>slice_stream_V_value_fu_36</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>8</item>
</second>
</item>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>2</count>
<item_version>0</item_version>
<item>
<first>grp_call_Loop_LB2D_buf_p_fu_40</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>12</item>
<item>12</item>
</second>
</item>
<item>
<first>grp_call_Loop_LB2D_shift_fu_47</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>13</item>
<item>13</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="64" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>1</count>
<item_version>0</item_version>
<item>
<first>54</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>8</item>
</second>
</item>
</dp_reg_nodes>
<dp_regname_nodes>
<count>1</count>
<item_version>0</item_version>
<item>
<first>slice_stream_V_value_reg_54</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>8</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>2</count>
<item_version>0</item_version>
<item class_id="66" tracking_level="0" version="0">
<first>in_stream_V_value_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>call</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>12</item>
</second>
</item>
</second>
</item>
<item>
<first>out_stream_V_value_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>call</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>13</item>
</second>
</item>
</second>
</item>
</dp_port_io_nodes>
<port2core class_id="67" tracking_level="0" version="0">
<count>2</count>
<item_version>0</item_version>
<item class_id="68" tracking_level="0" version="0">
<first>1</first>
<second>FIFO_SRL</second>
</item>
<item>
<first>2</first>
<second>FIFO_SRL</second>
</item>
</port2core>
<node2core>
<count>1</count>
<item_version>0</item_version>
<item>
<first>8</first>
<second>FIFO_SRL</second>
</item>
</node2core>
</syndb>
</boost_serialization>
|
package RCP is
-- the amount of resources required by every single request
-- can never exceed a predefined maximum quantity
Max_Requests : constant Positive := 10;
type Request_T is range 0 .. Max_Requests;
type Use_T is (Long, Medium, Short);
-- a descriptor type to denote the Item_T type and
-- the assignment status of individual resources
type Resource_T is record
Item : Use_T := Long;
Granted : Request_T := Request_T'First;
end record;
end RCP;
|
-- Copyright 2007-2020 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Pck; use Pck;
procedure Foo is
I : Integer := 1;
begin
Call_Me (Int => 1, Flt => 2.0, Bln => True, Ary => (1, 4, 8), Chr => 'j',
Sad => I'Address, Rec => (A => 3, B => 7));
end Foo;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.