Commit ad81d4f3 authored by yoogx's avatar yoogx
Browse files

* Use Get_Destination_Ports/Get_Source_Ports in place of

          direct AST accessors
parent d40f3e4e
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. -- -- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2016 ESA & ISAE. --
-- -- -- --
-- Ocarina is free software; you can redistribute it and/or modify under -- -- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -847,7 +847,7 @@ package body Ocarina.Backends.C_Common.Types is ...@@ -847,7 +847,7 @@ package body Ocarina.Backends.C_Common.Types is
end if; end if;
end case; end case;
-- Mark the data type as being handled an append it to -- Mark the data type as being handled and append it to
-- the handled list. -- the handled list.
Set_Handling (E, By_Name, H_C_Type_Spec, N); Set_Handling (E, By_Name, H_C_Type_Spec, N);
...@@ -1030,9 +1030,7 @@ package body Ocarina.Backends.C_Common.Types is ...@@ -1030,9 +1030,7 @@ package body Ocarina.Backends.C_Common.Types is
if not AINU.Is_Empty (Subcomponents (Remote_Process)) then if not AINU.Is_Empty (Subcomponents (Remote_Process)) then
S := First_Node (Subcomponents (Remote_Process)); S := First_Node (Subcomponents (Remote_Process));
while Present (S) loop while Present (S) loop
Visit (Corresponding_Instance (S)); Visit (Corresponding_Instance (S));
S := Next_Node (S); S := Next_Node (S);
end loop; end loop;
end if; end if;
...@@ -1042,7 +1040,8 @@ package body Ocarina.Backends.C_Common.Types is ...@@ -1042,7 +1040,8 @@ package body Ocarina.Backends.C_Common.Types is
and then Kind (I) = K_Port_Spec_Instance and then Kind (I) = K_Port_Spec_Instance
and then not AINU.Is_Empty (Destinations (I)) and then not AINU.Is_Empty (Destinations (I))
then then
F := First_Node (Destinations (I)); F := First_Node (Get_Destination_Ports (I));
while Present (F) loop while Present (F) loop
J := Item (F); J := Item (F);
...@@ -1064,7 +1063,7 @@ package body Ocarina.Backends.C_Common.Types is ...@@ -1064,7 +1063,7 @@ package body Ocarina.Backends.C_Common.Types is
if Kind (C) = K_Port_Spec_Instance if Kind (C) = K_Port_Spec_Instance
and then not AINU.Is_Empty (Sources (C)) and then not AINU.Is_Empty (Sources (C))
then then
D := First_Node (Sources (C)); D := First_Node (Get_Source_Ports (C));
I := Item (D); I := Item (D);
if Get_Category_Of_Component (Parent_Component (I)) = if Get_Category_Of_Component (Parent_Component (I)) =
...@@ -1074,10 +1073,9 @@ package body Ocarina.Backends.C_Common.Types is ...@@ -1074,10 +1073,9 @@ package body Ocarina.Backends.C_Common.Types is
if not AINU.Is_Empty (Subcomponents (Remote_Process)) then if not AINU.Is_Empty (Subcomponents (Remote_Process)) then
S := First_Node (Subcomponents (Remote_Process)); S := First_Node (Subcomponents (Remote_Process));
while Present (S) loop
while Present (S) loop
Visit (Corresponding_Instance (S)); Visit (Corresponding_Instance (S));
S := Next_Node (S); S := Next_Node (S);
end loop; end loop;
end if; end if;
...@@ -1085,15 +1083,15 @@ package body Ocarina.Backends.C_Common.Types is ...@@ -1085,15 +1083,15 @@ package body Ocarina.Backends.C_Common.Types is
if Present (I) if Present (I)
and then Kind (I) = K_Port_Spec_Instance and then Kind (I) = K_Port_Spec_Instance
and then not AINU.Is_Empty (Sources (I)) and then not AINU.Is_Empty (Get_Source_Ports (I))
then then
F := First_Node (Sources (I)); F := First_Node (Sources (I));
while Present (F) loop while Present (F) loop
J := Item (F); J := Item (F);
if Present (J) then if Present (J) then
Visit (Parent_Component (J)); Visit (Parent_Component (J));
end if; end if;
F := Next_Node (F); F := Next_Node (F);
end loop; end loop;
end if; end if;
...@@ -1112,15 +1110,15 @@ package body Ocarina.Backends.C_Common.Types is ...@@ -1112,15 +1110,15 @@ package body Ocarina.Backends.C_Common.Types is
while Present (Feature) loop while Present (Feature) loop
if not AINU.Is_Empty (Sources (Feature)) then if not AINU.Is_Empty (Sources (Feature)) then
Src := First_Node (Sources (Feature)); Src := First_Node (Get_Source_Ports (Feature));
while Present (Src) loop while Present (Src) loop
Parent := Parent_Component (Item (Src)); Parent := Parent_Component (Item (Src));
if AINU.Is_Process (Parent) and then Parent /= E then if AINU.Is_Process (Parent) and then Parent /= E then
if Get_Provided_Virtual_Bus_Class (Extra_Item (Src)) /= if Present (Extra_Item (Src))
No_Node and then Present (Get_Provided_Virtual_Bus_Class
(Extra_Item (Src)))
then then
Visit Visit
(Get_Provided_Virtual_Bus_Class (Get_Provided_Virtual_Bus_Class
...@@ -1135,7 +1133,7 @@ package body Ocarina.Backends.C_Common.Types is ...@@ -1135,7 +1133,7 @@ package body Ocarina.Backends.C_Common.Types is
-- The destinations of F -- The destinations of F
if not AINU.Is_Empty (Destinations (Feature)) then if not AINU.Is_Empty (Destinations (Feature)) then
Dst := First_Node (Destinations (Feature)); Dst := First_Node (Get_Destination_Ports (Feature));
while Present (Dst) loop while Present (Dst) loop
Parent := Parent_Component (Item (Dst)); Parent := Parent_Component (Item (Dst));
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. -- -- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2016 ESA & ISAE. --
-- -- -- --
-- Ocarina is free software; you can redistribute it and/or modify under -- -- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -1194,7 +1194,7 @@ package body Ocarina.Backends.PO_HI_C.Marshallers is ...@@ -1194,7 +1194,7 @@ package body Ocarina.Backends.PO_HI_C.Marshallers is
and then Kind (I) = K_Port_Spec_Instance and then Kind (I) = K_Port_Spec_Instance
and then not AAU.Is_Empty (Destinations (I)) and then not AAU.Is_Empty (Destinations (I))
then then
F := First_Node (Destinations (I)); F := First_Node (Get_Destination_Ports (I));
while Present (F) loop while Present (F) loop
J := Item (F); J := Item (F);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. -- -- Copyright (C) 2008-2009 Telecom ParisTech, 2010-2016 ESA & ISAE. --
-- -- -- --
-- Ocarina is free software; you can redistribute it and/or modify under -- -- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -199,7 +199,7 @@ package body Ocarina.Backends.PO_HI_C.Request is ...@@ -199,7 +199,7 @@ package body Ocarina.Backends.PO_HI_C.Request is
and then Is_Out (C) and then Is_Out (C)
and then not AINU.Is_Empty (Destinations (C)) and then not AINU.Is_Empty (Destinations (C))
then then
D := First_Node (Destinations (C)); D := First_Node (Get_Destination_Ports (C));
while Present (D) loop while Present (D) loop
I := Item (D); I := Item (D);
...@@ -207,7 +207,7 @@ package body Ocarina.Backends.PO_HI_C.Request is ...@@ -207,7 +207,7 @@ package body Ocarina.Backends.PO_HI_C.Request is
and then Kind (I) = K_Port_Spec_Instance and then Kind (I) = K_Port_Spec_Instance
and then not AINU.Is_Empty (Destinations (I)) and then not AINU.Is_Empty (Destinations (I))
then then
F := First_Node (Destinations (I)); F := First_Node (Get_Destination_Ports (I));
while Present (F) loop while Present (F) loop
J := Item (F); J := Item (F);
...@@ -495,7 +495,7 @@ package body Ocarina.Backends.PO_HI_C.Request is ...@@ -495,7 +495,7 @@ package body Ocarina.Backends.PO_HI_C.Request is
and then Kind (I) = K_Port_Spec_Instance and then Kind (I) = K_Port_Spec_Instance
and then not AINU.Is_Empty (Destinations (I)) and then not AINU.Is_Empty (Destinations (I))
then then
F := First_Node (Destinations (I)); F := First_Node (Get_Destination_Ports (I));
while Present (F) loop while Present (F) loop
J := Item (F); J := Item (F);
...@@ -528,7 +528,6 @@ package body Ocarina.Backends.PO_HI_C.Request is ...@@ -528,7 +528,6 @@ package body Ocarina.Backends.PO_HI_C.Request is
if Present (Backend_Node (Identifier (E))) if Present (Backend_Node (Identifier (E)))
and then Present (CTN.Request_Node (Backend_Node (Identifier (E)))) and then Present (CTN.Request_Node (Backend_Node (Identifier (E))))
then then
N := N :=
Make_Expression Make_Expression
(Left_Expr => (Left_Expr =>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment