File tree Expand file tree Collapse file tree 17 files changed +101
-71
lines changed
experiments/golden-results
testsuite/gnat2goto/tests
representation_clause_component_size_change
representation_clause_component_size Expand file tree Collapse file tree 17 files changed +101
-71
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,6 @@ Error message: Package declaration
44Nkind: N_Package_Declaration
55--
66Occurs: 1 times
7- Calling function: Process_Declaration
8- Error message: Representation clause unsupported: component_size
9- Nkind: N_Attribute_Definition_Clause
10- --
11- Occurs: 1 times
127Redacted compiler error message:
138"REDACTED" not declared in "REDACTED"
149Raw compiler error message:
Original file line number Diff line number Diff line change @@ -43,11 +43,6 @@ Calling function: Process_Pragma_Declaration
4343Error message: Unsupported pragma: Check
4444Nkind: N_Pragma
4545--
46- Occurs: 22 times
47- Calling function: Process_Declaration
48- Error message: Representation clause unsupported: component_size
49- Nkind: N_Attribute_Definition_Clause
50- --
5146Occurs: 21 times
5247Calling function: Process_Declaration
5348Error message: Package body declaration
Original file line number Diff line number Diff line change @@ -39,11 +39,6 @@ Error message: Abstract type declaration unsupported
3939Nkind: N_Private_Type_Declaration
4040--
4141Occurs: 7 times
42- Calling function: Process_Declaration
43- Error message: Representation clause unsupported: component_size
44- Nkind: N_Attribute_Definition_Clause
45- --
46- Occurs: 7 times
4742Calling function: Process_Pragma_Declaration
4843Error message: Unsupported pragma: Ada 05
4944Nkind: N_Pragma
Original file line number Diff line number Diff line change 1- Occurs: 42 times
2- Calling function: Process_Declaration
3- Error message: Representation clause unsupported: address
4- Nkind: N_Attribute_Definition_Clause
5- --
6- Occurs: 8 times
7- Calling function: Process_Declaration
8- Error message: Representation clause unsupported: component_size
9- Nkind: N_Attribute_Definition_Clause
10- --
111Occurs: 7 times
122Calling function: Process_Declaration
133Error message: Subprogram body stub declaration
@@ -38,16 +28,6 @@ Calling function: Do_Base_Range_Constraint
3828Error message: unsupported upper range kind
3929Nkind: N_Attribute_Reference
4030--
41- Occurs: 1 times
42- Calling function: Do_Operator_General
43- Error message: Mod of unsupported type
44- Nkind: N_Op_Not
45- --
46- Occurs: 1 times
47- Calling function: Process_Declaration
48- Error message: Use package clause declaration
49- Nkind: N_Use_Package_Clause
50- --
5131Occurs: 5 times
5232Redacted compiler error message:
5333"REDACTED" not declared in "REDACTED"
Original file line number Diff line number Diff line change @@ -24,11 +24,6 @@ Error message: Access type unsupported
2424Nkind: N_Access_To_Object_Definition
2525--
2626Occurs: 1 times
27- Calling function: Process_Declaration
28- Error message: Representation clause unsupported: component_size
29- Nkind: N_Attribute_Definition_Clause
30- --
31- Occurs: 1 times
3227Calling function: Process_Pragma_Declaration
3328Error message: Unsupported pragma: Ada 05
3429Nkind: N_Pragma
Original file line number Diff line number Diff line change @@ -39,11 +39,6 @@ Error message: Abstract subprogram declaration
3939Nkind: N_Abstract_Subprogram_Declaration
4040--
4141Occurs: 6 times
42- Calling function: Process_Declaration
43- Error message: Representation clause unsupported: component_size
44- Nkind: N_Attribute_Definition_Clause
45- --
46- Occurs: 6 times
4742Calling function: Process_Pragma_Declaration
4843Error message: Unsupported pragma: Ada 05
4944Nkind: N_Pragma
Original file line number Diff line number Diff line change @@ -18,11 +18,6 @@ Calling function: Do_Private_Type_Declaration
1818Error message: Abstract type declaration unsupported
1919Nkind: N_Private_Type_Declaration
2020--
21- Occurs: 46 times
22- Calling function: Process_Declaration
23- Error message: Representation clause unsupported: component_size
24- Nkind: N_Attribute_Definition_Clause
25- --
2621Occurs: 28 times
2722Calling function: Process_Declaration
2823Error message: Abstract subprogram declaration
Original file line number Diff line number Diff line change @@ -58,11 +58,6 @@ Calling function: Do_Procedure_Call_Statement
5858Error message: sym id not in symbol table
5959Nkind: N_Procedure_Call_Statement
6060--
61- Occurs: 2 times
62- Calling function: Process_Declaration
63- Error message: Representation clause unsupported: component_size
64- Nkind: N_Attribute_Definition_Clause
65- --
6661Occurs: 1 times
6762Calling function: Do_Function_Call
6863Error message: func name not in symbol table
Original file line number Diff line number Diff line change @@ -981,11 +981,9 @@ package body Arrays is
981981 return List_Element (Struct_Component, Last_Cursor);
982982 end Get_Last_Index_Component ;
983983
984- function Get_Data_Component (Array_Struct : Irep;
985- A_Symbol_Table : Symbol_Table) return Irep
984+ function Get_Data_Component_From_Type (Array_Struct_Type : Irep)
985+ return Irep
986986 is
987- Array_Struct_Type : constant Irep :=
988- Follow_Symbol_Type (Get_Type (Array_Struct), A_Symbol_Table);
989987 Struct_Component : constant Irep_List :=
990988 Get_Component (Get_Components (Array_Struct_Type));
991989 Last_Cursor : constant List_Cursor :=
@@ -994,6 +992,16 @@ package body Arrays is
994992 List_First (Struct_Component)));
995993 begin
996994 return List_Element (Struct_Component, Last_Cursor);
995+ end Get_Data_Component_From_Type ;
996+
997+ function Get_Data_Component (Array_Struct : Irep;
998+ A_Symbol_Table : Symbol_Table)
999+ return Irep
1000+ is
1001+ Array_Struct_Type : constant Irep :=
1002+ Follow_Symbol_Type (Get_Type (Array_Struct), A_Symbol_Table);
1003+ begin
1004+ return Get_Data_Component_From_Type (Array_Struct_Type);
9971005 end Get_Data_Component ;
9981006
9991007 function Get_First_Index (Array_Struct : Irep) return Irep
Original file line number Diff line number Diff line change @@ -46,6 +46,12 @@ package Arrays is
4646 function Do_Indexed_Component (N : Node_Id) return Irep
4747 with Pre => Nkind (N) = N_Indexed_Component;
4848
49+ function Get_Data_Component_From_Type (Array_Struct_Type : Irep)
50+ return Irep
51+ with Pre => Kind (Array_Struct_Type) in I_Struct_Type,
52+ Post => Kind (Get_Type (Get_Data_Component_From_Type'Result))
53+ in I_Pointer_Type;
54+
4955 function Get_First_Index (Array_Struct : Irep) return Irep
5056 with Pre => (Kind (Array_Struct) in Class_Expr
5157 and then Kind (Get_Type (Array_Struct)) in
You can’t perform that action at this time.
0 commit comments