Commit d3b05461 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Minor refactoring

parent d5d1bf6b
...@@ -11,8 +11,6 @@ with Ada.Strings.Unbounded, ...@@ -11,8 +11,6 @@ with Ada.Strings.Unbounded,
GNAT.OS_Lib, GNAT.OS_Lib,
Errors, Errors,
Locations, Locations,
-- Ocarina.Namet,
-- Ocarina.Types,
Namet, Namet,
Types, Types,
System.Assertions, System.Assertions,
...@@ -37,8 +35,6 @@ use Ada.Strings.Unbounded, ...@@ -37,8 +35,6 @@ use Ada.Strings.Unbounded,
Ada.Text_IO, Ada.Text_IO,
Ada.Characters.Handling, Ada.Characters.Handling,
Locations, Locations,
-- Ocarina.Namet,
-- Ocarina.Types,
Namet, Namet,
Types, Types,
Ocarina, Ocarina,
......
...@@ -407,29 +407,31 @@ package body Buildsupport_Utils is ...@@ -407,29 +407,31 @@ package body Buildsupport_Utils is
function Rec_Function (Prefix : String := ""; function Rec_Function (Prefix : String := "";
Func : Node_Id) return Functions.Vector is Func : Node_Id) return Functions.Vector is
Inner : Node_Id; Inner : Node_Id;
Result : Functions.Vector := Functions.Empty_Vector; Res : Functions.Vector := Functions.Empty_Vector;
CI : constant Node_Id := Corresponding_Instance (Func); CI : constant Node_Id := Corresponding_Instance (Func);
Name : constant String := Prefix & Name : constant String := Prefix &
(if Prefix'Length > 0 then "_" else "") & AIN_Case (Func); (if Prefix'Length > 0 then "_" else "") & AIN_Case (Func);
begin begin
if Get_Category_Of_Component (CI) /= CC_System then
null;
elsif Present (AIN.Subcomponents (CI)) then
Inner := AIN.First_Node (AIN.Subcomponents (CI));
while Present (Inner) loop
Result := Result & Rec_Function (Prefix => Name,
Func => Inner);
Inner := AIN.Next_Node (Inner);
end loop;
end if;
if Get_Category_Of_Component (CI) = CC_System and then case Get_Category_Of_Component (CI) is
(No (AIN.Subcomponents (CI)) or Result = Functions.Empty_Vector) when CC_System =>
then if Present (AIN.Subcomponents (CI)) then
Result := Result & Parse_Function (Name => Name, Inner := AIN.First_Node (AIN.Subcomponents (CI));
Inst => CI); while Present (Inner) loop
end if; Res := Res & Rec_Function (Prefix => Name, Func => Inner);
return Result; Inner := AIN.Next_Node (Inner);
end loop;
end if;
if No (AIN.Subcomponents (CI)) or Res = Functions.Empty_Vector
then
Res := Res & Parse_Function (Name => Name, Inst => CI);
end if;
when others =>
null;
end case;
return Res;
end Rec_Function; end Rec_Function;
begin begin
Exit_On_Error (No (System), "Missing or erroneous interface view"); Exit_On_Error (No (System), "Missing or erroneous interface view");
......
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