Commit f43d6356 authored by hugues.jerome's avatar hugues.jerome

* Minor reformatting



git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/ocarina@1483 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent a368f8ee
...@@ -206,7 +206,6 @@ package body Ocarina.Backends.C_Common.Subprograms is ...@@ -206,7 +206,6 @@ package body Ocarina.Backends.C_Common.Subprograms is
S := First_Node (Features (E)); S := First_Node (Features (E));
while Present (S) loop while Present (S) loop
Visit (Corresponding_Instance (S)); Visit (Corresponding_Instance (S));
S := Next_Node (S); S := Next_Node (S);
...@@ -404,12 +403,14 @@ package body Ocarina.Backends.C_Common.Subprograms is ...@@ -404,12 +403,14 @@ package body Ocarina.Backends.C_Common.Subprograms is
-- Visit the component instance corresponding to the -- Visit the component instance corresponding to the
-- subcomponent S. -- subcomponent S.
if Get_Current_Backend_Kind = PolyORB_Kernel_C if Get_Current_Backend_Kind = PolyORB_Kernel_C
and then Get_Category_Of_Component and then Get_Category_Of_Component
(Corresponding_Instance (S)) = CC_Process then (Corresponding_Instance (S)) = CC_Process
then
null; null;
else else
if Get_Category_Of_Component if Get_Category_Of_Component
(Corresponding_Instance (S)) /= CC_Device then (Corresponding_Instance (S)) /= CC_Device
then
Visit (Corresponding_Instance (S)); Visit (Corresponding_Instance (S));
end if; end if;
end if; end if;
...@@ -439,8 +440,8 @@ package body Ocarina.Backends.C_Common.Subprograms is ...@@ -439,8 +440,8 @@ package body Ocarina.Backends.C_Common.Subprograms is
if Kind (Feature) = K_Port_Spec_Instance if Kind (Feature) = K_Port_Spec_Instance
and then Is_In (Feature) and then Is_In (Feature)
and then Is_Event (Feature) and then Is_Event (Feature)
and then not Is_Data (Feature) then and then not Is_Data (Feature)
then
if Get_Port_Compute_Entrypoint (Feature) /= No_Node then if Get_Port_Compute_Entrypoint (Feature) /= No_Node then
Visit (Get_Port_Compute_Entrypoint (Feature)); Visit (Get_Port_Compute_Entrypoint (Feature));
end if; end if;
......
...@@ -806,34 +806,32 @@ package body Ocarina.Backends.C_Common.Types is ...@@ -806,34 +806,32 @@ package body Ocarina.Backends.C_Common.Types is
Start_Recording_Handlings; Start_Recording_Handlings;
if Get_Current_Backend_Kind = PolyORB_Kernel_C and then if Get_Current_Backend_Kind = PolyORB_Kernel_C
not AINU.Is_Empty (Subcomponents (E)) then and then not AINU.Is_Empty (Subcomponents (E))
then
S := First_Node (Subcomponents (E)); S := First_Node (Subcomponents (E));
while Present (S) loop while Present (S) loop
-- Visit the component instance corresponding to the -- Visit the component instance corresponding to the
-- subcomponent S. -- subcomponent S.
if AINU.Is_Data (Corresponding_Instance (S)) and then if AINU.Is_Data (Corresponding_Instance (S))
Is_Protected_Data (Corresponding_Instance (S)) then and then Is_Protected_Data (Corresponding_Instance (S))
then
Add_Include (PKR.RH (RH_Deployment)); Add_Include (PKR.RH (RH_Deployment));
if POK_Flavor = ARINC653 then if POK_Flavor = ARINC653 then
Declaration := Make_Extern_Entity_Declaration Declaration := Make_Extern_Entity_Declaration
(Make_Variable_Declaration (Make_Variable_Declaration
(Make_Defining_Identifier (Make_Defining_Identifier
(Map_Associated_Locking_Entity_Name (Map_Associated_Locking_Entity_Name (S)),
(S)), PKR.RE (RE_Semaphore_Id_Type)));
PKR.RE (RE_Semaphore_Id_Type)));
else else
Declaration := Make_Extern_Entity_Declaration Declaration := Make_Extern_Entity_Declaration
(Make_Variable_Declaration (Make_Variable_Declaration
(Make_Defining_Identifier (Make_Defining_Identifier
(Map_Associated_Locking_Entity_Name (Map_Associated_Locking_Entity_Name (S)),
(S)), PKR.RE (RE_Pok_Sem_Id_T)));
PKR.RE (RE_Pok_Sem_Id_T)));
end if; end if;
Append_Node_To_List Append_Node_To_List
......
...@@ -1663,7 +1663,7 @@ package body Ocarina.Backends.C_Tree.Nutils is ...@@ -1663,7 +1663,7 @@ package body Ocarina.Backends.C_Tree.Nutils is
Hybrid : constant Boolean := Hybrid : constant Boolean :=
AINU.Is_Subprogram (Caller) and then AINU.Is_Subprogram (Caller) and then
Properties.Get_Subprogram_Kind (Caller) = Properties.Get_Subprogram_Kind (Caller) =
Properties.Subprogram_Hybrid_Ada_95; Properties.Subprogram_Hybrid_Ada_95; -- XXX why Ada ?
begin begin
-- The lists have to be created -- The lists have to be created
......
...@@ -659,7 +659,7 @@ package body Ocarina.Backends.PO_HI_Ada.Types is ...@@ -659,7 +659,7 @@ package body Ocarina.Backends.PO_HI_Ada.Types is
if CCP /= Concurrency_Priority_Ceiling then if CCP /= Concurrency_Priority_Ceiling then
Display_Located_Error Display_Located_Error
(Loc (E), (Loc (E),
"Incompatoble concurrency protocol, " "Incompatible concurrency protocol, "
& "PolyORB-HI/Ada requires " & "PolyORB-HI/Ada requires "
& "Priority_Ceiling", & "Priority_Ceiling",
True); True);
......
...@@ -1507,7 +1507,7 @@ package body Ocarina.Backends.PO_HI_C.Activity is ...@@ -1507,7 +1507,7 @@ package body Ocarina.Backends.PO_HI_C.Activity is
N := Make_Variable_Declaration N := Make_Variable_Declaration
(Map_C_Defining_Identifier (S), (Map_C_Defining_Identifier (S),
Map_C_Data_Type_Designator Map_C_Data_Type_Designator
(Corresponding_Instance (S))); (Corresponding_Instance (S)));
Append_Node_To_List Append_Node_To_List
(Make_Extern_Entity_Declaration (N), (Make_Extern_Entity_Declaration (N),
......
...@@ -285,11 +285,11 @@ package body Ocarina.Instances.Components.Subprogram_Calls is ...@@ -285,11 +285,11 @@ package body Ocarina.Instances.Components.Subprogram_Calls is
return No_Node; return No_Node;
end if; end if;
end; end;
else else
Display_No_Entity_Ref (New_Instance); Display_No_Entity_Ref (New_Instance);
return No_Node; return No_Node;
end if; end if;
end Instantiate_Subprogram_Call; end Instantiate_Subprogram_Call;
---------------------------------------- ----------------------------------------
...@@ -316,14 +316,16 @@ package body Ocarina.Instances.Components.Subprogram_Calls is ...@@ -316,14 +316,16 @@ package body Ocarina.Instances.Components.Subprogram_Calls is
New_Subinstance := Instantiate_Component New_Subinstance := Instantiate_Component
(Instance_Root, (Instance_Root,
Corresponding_Declaration Corresponding_Declaration
(Corresponding_Instance (Call_Instance))); (Corresponding_Instance (Call_Instance)));
if Present (New_Subinstance) then if Present (New_Subinstance) then
Set_Corresponding_Instance (Call_Instance, New_Subinstance); Set_Corresponding_Instance (Call_Instance, New_Subinstance);
return Call_Instance; return Call_Instance;
else else
return No_Node; return No_Node;
end if; end if;
else else
return Call_Instance; return Call_Instance;
end if; end if;
......
...@@ -48,10 +48,10 @@ package body Ocarina.Instances.Queries is ...@@ -48,10 +48,10 @@ package body Ocarina.Instances.Queries is
use Ocarina.ME_AADL.AADL_Instances.Entities; use Ocarina.ME_AADL.AADL_Instances.Entities;
use Ocarina.ME_AADL.AADL_Tree.Entities.Properties; use Ocarina.ME_AADL.AADL_Tree.Entities.Properties;
package ATN renames Ocarina.ME_AADL.AADL_Tree.Nodes; package ATN renames Ocarina.ME_AADL.AADL_Tree.Nodes;
package AIN renames Ocarina.ME_AADL.AADL_Instances.Nodes; package AIN renames Ocarina.ME_AADL.AADL_Instances.Nodes;
package AIEP renames Ocarina.ME_AADL.AADL_Instances.Entities.Properties; package AIEP renames Ocarina.ME_AADL.AADL_Instances.Entities.Properties;
package ATE renames Ocarina.ME_AADL.AADL_Tree.Entities; package ATE renames Ocarina.ME_AADL.AADL_Tree.Entities;
------------------------------------- -------------------------------------
-- Compute_Absolute_Name_Of_Entity -- -- Compute_Absolute_Name_Of_Entity --
...@@ -125,14 +125,10 @@ package body Ocarina.Instances.Queries is ...@@ -125,14 +125,10 @@ package body Ocarina.Instances.Queries is
begin begin
return Present (AIEP.Find_Property_Association_From_Name return Present (AIEP.Find_Property_Association_From_Name
(Property_List => AIN.Properties (Entity), (Property_List => AIN.Properties (Entity),
Property_Name => Name, Property_Name => Name,
In_Mode => In_Mode)); In_Mode => In_Mode));
end Is_Defined_Property; end Is_Defined_Property;
-------------------------
-- Is_Defined_Property --
-------------------------
function Is_Defined_Property function Is_Defined_Property
(Entity : Node_Id; (Entity : Node_Id;
Name : String; Name : String;
...@@ -143,10 +139,8 @@ package body Ocarina.Instances.Queries is ...@@ -143,10 +139,8 @@ package body Ocarina.Instances.Queries is
begin begin
Set_Str_To_Name_Buffer (Name); Set_Str_To_Name_Buffer (Name);
Name2 := Name_find; Name2 := Name_find;
return Present (AIEP.Find_Property_Association_From_Name
(Property_List => AIN.Properties (Entity), return Is_Defined_Property (Entity, Name2, In_Mode);
Property_Name => Name2,
In_Mode => In_Mode));
end Is_Defined_Property; end Is_Defined_Property;
---------------------------- ----------------------------
...@@ -154,20 +148,24 @@ package body Ocarina.Instances.Queries is ...@@ -154,20 +148,24 @@ package body Ocarina.Instances.Queries is
---------------------------- ----------------------------
function Compute_Property_Value (Property_Value : Node_Id) return Node_Id is function Compute_Property_Value (Property_Value : Node_Id) return Node_Id is
pragma Assert (ATN.Kind (Property_Value) = K_Property_Value); pragma Assert (ATN.Kind (Property_Value) = K_Property_Value);
Property_Expression : Node_Id; Property_Expression : Node_Id;
begin begin
if Expanded_Single_Value (Property_Value) /= No_Node then if Expanded_Single_Value (Property_Value) /= No_Node then
Property_Expression := Expanded_Single_Value (Property_Value); Property_Expression := Expanded_Single_Value (Property_Value);
elsif Expanded_Multi_Value (Property_Value) /= No_List then elsif Expanded_Multi_Value (Property_Value) /= No_List then
Property_Expression := Property_Expression :=
ATN.First_Node (Expanded_Multi_Value (Property_Value)); ATN.First_Node (Expanded_Multi_Value (Property_Value));
elsif Single_Value (Property_Value) /= No_Node then elsif Single_Value (Property_Value) /= No_Node then
Property_Expression := Single_Value (Property_Value); Property_Expression := Single_Value (Property_Value);
elsif Multi_Value (Property_Value) /= No_List then elsif Multi_Value (Property_Value) /= No_List then
Property_Expression := ATN.First_Node (Multi_Value (Property_Value)); Property_Expression := ATN.First_Node (Multi_Value (Property_Value));
else else
Property_Expression := No_Node; Property_Expression := No_Node;
end if; end if;
...@@ -258,11 +256,10 @@ package body Ocarina.Instances.Queries is ...@@ -258,11 +256,10 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name) In_Mode : Name_Id := No_Name)
return Name_Id return Name_Id
is is
Property_Value : Node_Id; Property_Value : constant Node_Id := Get_Value_Of_Property_Association
begin
Property_Value := Get_Value_Of_Property_Association
(Entity, Name, In_Mode); (Entity, Name, In_Mode);
begin
if Property_Value /= No_Node then if Property_Value /= No_Node then
if Get_Type_Of_Property_Value if Get_Type_Of_Property_Value
(Property_Value, True) = PT_Enumeration (Property_Value, True) = PT_Enumeration
...@@ -286,11 +283,10 @@ package body Ocarina.Instances.Queries is ...@@ -286,11 +283,10 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name) In_Mode : Name_Id := No_Name)
return Long_Long_Float return Long_Long_Float
is is
Property_Value : Node_Id; Property_Value : constant Node_Id := Get_Value_Of_Property_Association
begin
Property_Value := Get_Value_Of_Property_Association
(Entity, Name, In_Mode); (Entity, Name, In_Mode);
begin
if Property_Value /= No_Node then if Property_Value /= No_Node then
if Get_Type_Of_Property_Value (Property_Value, True) = PT_Float if Get_Type_Of_Property_Value (Property_Value, True) = PT_Float
or else Get_Type_Of_Property_Value or else Get_Type_Of_Property_Value
...@@ -315,11 +311,10 @@ package body Ocarina.Instances.Queries is ...@@ -315,11 +311,10 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name) In_Mode : Name_Id := No_Name)
return Unsigned_Long_Long return Unsigned_Long_Long
is is
Property_Value : Node_Id; Property_Value : constant Node_Id := Get_Value_Of_Property_Association
begin
Property_Value := Get_Value_Of_Property_Association
(Entity, Name, In_Mode); (Entity, Name, In_Mode);
begin
if Property_Value /= No_Node then if Property_Value /= No_Node then
if Get_Type_Of_Property_Value (Property_Value, True) = PT_Integer if Get_Type_Of_Property_Value (Property_Value, True) = PT_Integer
or else Get_Type_Of_Property_Value or else Get_Type_Of_Property_Value
...@@ -388,11 +383,10 @@ package body Ocarina.Instances.Queries is ...@@ -388,11 +383,10 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name) In_Mode : Name_Id := No_Name)
return Node_Id return Node_Id
is is
Property_Value : Node_Id; Property_Value : constant Node_Id := Get_Value_Of_Property_Association
begin
Property_Value := Get_Value_Of_Property_Association
(Entity, Name, In_Mode); (Entity, Name, In_Mode);
begin
if Property_Value /= No_Node then if Property_Value /= No_Node then
if Get_Type_Of_Property_Value if Get_Type_Of_Property_Value
(Property_Value, True) = PT_Classifier (Property_Value, True) = PT_Classifier
...@@ -406,10 +400,6 @@ package body Ocarina.Instances.Queries is ...@@ -406,10 +400,6 @@ package body Ocarina.Instances.Queries is
end if; end if;
end Get_Classifier_Property; end Get_Classifier_Property;
-----------------------------
-- Get_Classifier_Property --
-----------------------------
function Get_Classifier_Property function Get_Classifier_Property
(Entity : Node_Id; (Entity : Node_Id;
Name : String; Name : String;
...@@ -432,17 +422,13 @@ package body Ocarina.Instances.Queries is ...@@ -432,17 +422,13 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name) In_Mode : Name_Id := No_Name)
return Node_Id return Node_Id
is is
Property : constant Node_Id := AIEP.Find_Property_Association_From_Name Property : constant Node_Id := Get_Property_Association
(Property_List => AIN.Properties (Entity), (Entity, Name, In_Mode);
Property_Name => Name,
In_Mode => In_Mode);
begin
if Property = No_Node then
return No_Node;
end if;
if Get_Type_Of_Property (Property) /= PT_Range then begin
if No (Property)
or else Get_Type_Of_Property (Property) /= PT_Range
then
return No_Node; return No_Node;
end if; end if;
...@@ -459,12 +445,11 @@ package body Ocarina.Instances.Queries is ...@@ -459,12 +445,11 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name) In_Mode : Name_Id := No_Name)
return List_Id return List_Id
is is
Property : constant Node_Id := AIEP.Find_Property_Association_From_Name Property : constant Node_Id := Get_Property_Association
(Property_List => AIN.Properties (Entity), (Entity, Name, In_Mode);
Property_Name => Name,
In_Mode => In_Mode);
begin begin
if not Type_Of_Property_Is_A_List if No (Property)
or else not Type_Of_Property_Is_A_List
(ATE.Get_Referenced_Entity (AIN.Property_Name (Property))) (ATE.Get_Referenced_Entity (AIN.Property_Name (Property)))
then then
return No_List; return No_List;
...@@ -473,10 +458,6 @@ package body Ocarina.Instances.Queries is ...@@ -473,10 +458,6 @@ package body Ocarina.Instances.Queries is
return Expanded_Multi_Value (AIN.Property_Association_Value (Property)); return Expanded_Multi_Value (AIN.Property_Association_Value (Property));
end Get_List_Property; end Get_List_Property;
-----------------------
-- Get_List_Property --
-----------------------
function Get_List_Property function Get_List_Property
(Entity : Node_Id; (Entity : Node_Id;
Name : String; Name : String;
...@@ -497,11 +478,10 @@ package body Ocarina.Instances.Queries is ...@@ -497,11 +478,10 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name) In_Mode : Name_Id := No_Name)
return String return String
is is
Property_Value : Node_Id; Property_Value : constant Node_Id := Get_Value_Of_Property_Association
begin
Property_Value := Get_Value_Of_Property_Association
(Entity, Name, In_Mode); (Entity, Name, In_Mode);
begin
if Property_Value /= No_Node then if Property_Value /= No_Node then
if Get_Type_Of_Property_Value (Property_Value, True) = PT_String then if Get_Type_Of_Property_Value (Property_Value, True) = PT_String then
return Get_String_Of_Property_Value (Property_Value); return Get_String_Of_Property_Value (Property_Value);
...@@ -513,21 +493,16 @@ package body Ocarina.Instances.Queries is ...@@ -513,21 +493,16 @@ package body Ocarina.Instances.Queries is
end if; end if;
end Get_String_Property; end Get_String_Property;
-------------------------
-- Get_String_Property --
-------------------------
function Get_String_Property function Get_String_Property
(Entity : Node_Id; (Entity : Node_Id;
Name : Name_Id; Name : Name_Id;
In_Mode : Name_Id := No_Name) In_Mode : Name_Id := No_Name)
return Name_Id return Name_Id
is is
Property_Value : Node_Id; Property_Value : constant Node_Id := Get_Value_Of_Property_Association
begin
Property_Value := Get_Value_Of_Property_Association
(Entity, Name, In_Mode); (Entity, Name, In_Mode);
begin
if Property_Value /= No_Node then if Property_Value /= No_Node then
if Get_Type_Of_Property_Value (Property_Value, True) = PT_String then if Get_Type_Of_Property_Value (Property_Value, True) = PT_String then
return Get_String_Of_Property_Value (Property_Value); return Get_String_Of_Property_Value (Property_Value);
...@@ -539,33 +514,18 @@ package body Ocarina.Instances.Queries is ...@@ -539,33 +514,18 @@ package body Ocarina.Instances.Queries is
end if; end if;
end Get_String_Property; end Get_String_Property;
-------------------------
-- Get_String_Property --
-------------------------
function Get_String_Property function Get_String_Property
(Entity : Node_Id; (Entity : Node_Id;
Name : String; Name : String;
In_Mode : Name_Id := No_Name) In_Mode : Name_Id := No_Name)
return Name_Id return Name_Id
is is
Property_Value : Node_Id;
Name2 : Name_Id; Name2 : Name_Id;
begin begin
Set_Str_To_Name_Buffer (Name); Set_Str_To_Name_Buffer (Name);
Name2 := Name_Find; Name2 := Name_Find;
Property_Value := Get_Value_Of_Property_Association
(Entity, Name2, In_Mode);
if Property_Value /= No_Node then return Get_String_Property (Entity, Name2, In_Mode);
if Get_Type_Of_Property_Value (Property_Value, True) = PT_String then
return Get_String_Of_Property_Value (Property_Value);
else
return No_Name;
end if;
else
return No_Name;
end if;
end Get_String_Property; end Get_String_Property;
--------------------------------------- ---------------------------------------
...@@ -578,17 +538,16 @@ package body Ocarina.Instances.Queries is ...@@ -578,17 +538,16 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name) In_Mode : Name_Id := No_Name)
return Node_Id return Node_Id
is is
Property : constant Node_Id := AIEP.Find_Property_Association_From_Name Property : constant Node_Id := Get_Property_Association
(Property_List => AIN.Properties (Entity), (Entity, Name, In_Mode);
Property_Name => Name, Value : Node_Id := No_Node;
In_Mode => In_Mode);
begin begin
if Property /= No_Node then if Present (Property) then
return Compute_Property_Value Value := Compute_Property_Value
(AIN.Property_Association_Value (Property)); (AIN.Property_Association_Value (Property));
else
return No_Node;
end if; end if;
return Value;
end Get_Value_Of_Property_Association; end Get_Value_Of_Property_Association;
--------------------------------- ---------------------------------
...@@ -601,11 +560,10 @@ package body Ocarina.Instances.Queries is ...@@ -601,11 +560,10 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name) In_Mode : Name_Id := No_Name)
return Boolean return Boolean
is is
Property_Value : Node_Id; Property_Value : constant Node_Id := Get_Value_Of_Property_Association
begin
Property_Value := Get_Value_Of_Property_Association
(Entity, Name, In_Mode); (Entity, Name, In_Mode);
begin
return Present (Property_Value) and then return Present (Property_Value) and then
Get_Type_Of_Property_Value (Property_Value, True) = PT_Boolean; Get_Type_Of_Property_Value (Property_Value, True) = PT_Boolean;
end Is_Defined_Boolean_Property; end Is_Defined_Boolean_Property;
...@@ -620,11 +578,10 @@ package body Ocarina.Instances.Queries is ...@@ -620,11 +578,10 @@ package body Ocarina.Instances.Queries is
In_Mode : Name_Id := No_Name) In_Mode : Name_Id := No_Name)
return Boolean return Boolean
is is