Commit 12761e48 authored by Jerome Hugues's avatar Jerome Hugues
Browse files

* (Map_C_Enumerator_Name): Add the option to fully qualify name with

parentn name
parent 96289202
...@@ -926,12 +926,13 @@ package body Ocarina.Backends.C_Common.Mapping is ...@@ -926,12 +926,13 @@ package body Ocarina.Backends.C_Common.Mapping is
--------------------------- ---------------------------
function Map_C_Enumerator_Name function Map_C_Enumerator_Name
(E : Node_Id; (E : Node_Id;
Custom_Parent : Node_Id := No_Node; Custom_Parent : Node_Id := No_Node;
Entity : Boolean := False; Fully_Qualify_Parent : Boolean := False;
Server : Boolean := False; Entity : Boolean := False;
Port_Type : Boolean := False; Server : Boolean := False;
Local_Port : Boolean := False) return Name_Id Port_Type : Boolean := False;
Local_Port : Boolean := False) return Name_Id
is is
C_Name_1 : Name_Id; C_Name_1 : Name_Id;
C_Name_2 : Name_Id; C_Name_2 : Name_Id;
...@@ -939,10 +940,19 @@ package body Ocarina.Backends.C_Common.Mapping is ...@@ -939,10 +940,19 @@ package body Ocarina.Backends.C_Common.Mapping is
if Kind (E) = K_Port_Spec_Instance then if Kind (E) = K_Port_Spec_Instance then
C_Name_1 := CTU.To_C_Name (Display_Name (Identifier (E))); C_Name_1 := CTU.To_C_Name (Display_Name (Identifier (E)));
Get_Name_String if Fully_Qualify_Parent then
(CTU.To_C_Name Get_Name_String
(Display_Name (CTU.To_C_Name
(Identifier (Parent_Subcomponent (Parent_Component (E)))))); (Fully_Qualified_Instance_Name
(Parent_Component ((E)))));
else
Get_Name_String
(CTU.To_C_Name
(Display_Name
(Identifier (Parent_Subcomponent
(Parent_Component (E))))));
end if;
if Local_Port then if Local_Port then
Add_Str_To_Name_Buffer ("_local_"); Add_Str_To_Name_Buffer ("_local_");
Get_Name_String_And_Append (C_Name_1); Get_Name_String_And_Append (C_Name_1);
......
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