aboutsummaryrefslogtreecommitdiffstats
path: root/translate/grt/grt-rtis_utils.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2014-01-25 07:21:37 +0100
committerTristan Gingold <tgingold@free.fr>2014-01-25 07:21:37 +0100
commitee043778d9323fa1879389dee570c87d8f3903a7 (patch)
tree60c0a0287c8fa8da6f5c109b8985ad9d8ef39431 /translate/grt/grt-rtis_utils.adb
parentda76e8be06184b9362ae4998a950cb2d31a347a0 (diff)
downloadghdl-ee043778d9323fa1879389dee570c87d8f3903a7.tar.gz
ghdl-ee043778d9323fa1879389dee570c87d8f3903a7.tar.bz2
ghdl-ee043778d9323fa1879389dee570c87d8f3903a7.zip
Get rid of union in ghdl_rtin_unit.
Replace ghdl_rtik_unit with ghdl_rtik_unit64 and ghdl_rtik_unitptr. (Preliminary work for llvm).
Diffstat (limited to 'translate/grt/grt-rtis_utils.adb')
-rw-r--r--translate/grt/grt-rtis_utils.adb26
1 files changed, 20 insertions, 6 deletions
diff --git a/translate/grt/grt-rtis_utils.adb b/translate/grt/grt-rtis_utils.adb
index f8ff5d62f..1c526c360 100644
--- a/translate/grt/grt-rtis_utils.adb
+++ b/translate/grt/grt-rtis_utils.adb
@@ -446,9 +446,9 @@ package body Grt.Rtis_Utils is
begin
To_String (S, F, Value.I32);
Append (Str, S (F .. S'Last));
- Append (Str,
- To_Ghdl_Rtin_Unit_Acc (To_Ghdl_Rtin_Type_Physical_Acc
- (Type_Rti).Units (0)).Name);
+ Append
+ (Str, Get_Physical_Unit_Name
+ (To_Ghdl_Rtin_Type_Physical_Acc (Type_Rti).Units (0)));
end;
when Ghdl_Rtik_Type_P64 =>
declare
@@ -457,9 +457,9 @@ package body Grt.Rtis_Utils is
begin
To_String (S, F, Value.I64);
Append (Str, S (F .. S'Last));
- Append (Str,
- To_Ghdl_Rtin_Unit_Acc (To_Ghdl_Rtin_Type_Physical_Acc
- (Type_Rti).Units (0)).Name);
+ Append
+ (Str, Get_Physical_Unit_Name
+ (To_Ghdl_Rtin_Type_Physical_Acc (Type_Rti).Units (0)));
end;
when others =>
Internal_Error ("grt.rtis_utils.get_value");
@@ -477,6 +477,20 @@ package body Grt.Rtis_Utils is
Free (Name);
end Disp_Value;
+ function Get_Physical_Unit_Name (Unit : Ghdl_Rti_Access)
+ return Ghdl_C_String
+ is
+ begin
+ case Unit.Kind is
+ when Ghdl_Rtik_Unit64 =>
+ return To_Ghdl_Rtin_Unit64_Acc (Unit).Name;
+ when Ghdl_Rtik_Unitptr =>
+ return To_Ghdl_Rtin_Unitptr_Acc (Unit).Name;
+ when others =>
+ Internal_Error ("rtis_utils.physical_unit_name");
+ end case;
+ end Get_Physical_Unit_Name;
+
procedure Get_Enum_Value
(Rstr : in out Rstring; Rti : Ghdl_Rti_Access; Val : Ghdl_Index_Type)
is