Commit d22ea2c8 authored by Rahma BOUAZIZ's avatar Rahma BOUAZIZ Committed by yoogx
Browse files

* (Has_Behavior_Specification): return true if a component as

          a Behavior_Specification annex subclause

          For openaadl/ocarina#190
parent 78ab1f13
......@@ -49,6 +49,7 @@ with Ocarina.Backends.Ada_Tree.Nutils;
with Ocarina.Backends.Ada_Values;
with Ocarina.Instances.Queries;
with Ocarina.Backends.Helper;
with Utils; use Utils;
package body Ocarina.Backends.Utils is
......@@ -4156,4 +4157,28 @@ package body Ocarina.Backends.Utils is
end if;
end Visit_Subcomponents_Of_G;
--------------------------------
-- Has_Behavior_Specification --
--------------------------------
function Has_Behavior_Specification (E : Node_Id) return Boolean is
F : Node_Id;
begin
if not AAU.Is_Empty (Annexes (E)) then
F := First_Node (Annexes (E));
while Present (F) loop
if (To_Upper (AIN.Display_Name (AIN.Identifier (F))) =
To_Upper (Get_String_Name ("behavior_specification")))
then
return True;
end if;
F := Next_Node (F);
end loop;
end if;
return False;
end Has_Behavior_Specification;
end Ocarina.Backends.Utils;
......@@ -514,4 +514,8 @@ package Ocarina.Backends.Utils is
function Get_Number_Of_Cores (P : Node_Id) return Unsigned_Long_Long;
-- Return the number of cores attached to the processor P
function Has_Behavior_Specification (E : Node_Id) return Boolean;
-- Return True IFF the subprogram instance E contains a Behavior
-- Specification.
end Ocarina.Backends.Utils;
Supports Markdown
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