aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/translate/trans-chap5.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-01-10 11:05:31 +0100
committerTristan Gingold <tgingold@free.fr>2016-01-11 21:26:34 +0100
commit15cf5147f7a97759ac3385d214533d5500b3f9c3 (patch)
treea8fadfb9f535115e30eee9add144a5b3219e6e30 /src/vhdl/translate/trans-chap5.adb
parent4e110147adc921386c8b4e9cf4d1a9a5d20ee4ec (diff)
downloadghdl-15cf5147f7a97759ac3385d214533d5500b3f9c3.tar.gz
ghdl-15cf5147f7a97759ac3385d214533d5500b3f9c3.tar.bz2
ghdl-15cf5147f7a97759ac3385d214533d5500b3f9c3.zip
Set type staticness for a constant declaration and attribute specification.
Fix for issue 10.
Diffstat (limited to 'src/vhdl/translate/trans-chap5.adb')
-rw-r--r--src/vhdl/translate/trans-chap5.adb21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/vhdl/translate/trans-chap5.adb b/src/vhdl/translate/trans-chap5.adb
index f51e3c0a0..f52de48be 100644
--- a/src/vhdl/translate/trans-chap5.adb
+++ b/src/vhdl/translate/trans-chap5.adb
@@ -33,31 +33,32 @@ package body Trans.Chap5 is
procedure Translate_Attribute_Specification
(Spec : Iir_Attribute_Specification)
is
+ Spec_Type : constant Iir := Get_Type (Spec);
Attr : constant Iir_Attribute_Declaration :=
Get_Named_Entity (Get_Attribute_Designator (Spec));
- Atinfo : constant Type_Info_Acc := Get_Info (Get_Type (Attr));
Mark : Id_Mark_Type;
+ Mark2 : Id_Mark_Type;
Info : Object_Info_Acc;
begin
Push_Identifier_Prefix_Uniq (Mark);
+ if Is_Anonymous_Type_Definition (Spec_Type) then
+ Push_Identifier_Prefix (Mark2, "OT");
+ Chap3.Translate_Type_Definition (Spec_Type, True);
+ Pop_Identifier_Prefix (Mark2);
+ end if;
Info := Add_Info (Spec, Kind_Object);
Info.Object_Var := Create_Var
(Create_Var_Identifier (Attr),
- Chap4.Get_Object_Type (Atinfo, Mode_Value),
+ Chap4.Get_Object_Type (Get_Info (Spec_Type), Mode_Value),
Global_Storage);
Pop_Identifier_Prefix (Mark);
end Translate_Attribute_Specification;
procedure Elab_Attribute_Specification
- (Spec : Iir_Attribute_Specification)
- is
- Attr : constant Iir_Attribute_Declaration :=
- Get_Named_Entity (Get_Attribute_Designator (Spec));
+ (Spec : Iir_Attribute_Specification) is
begin
- -- Kludge
- Set_Info (Attr, Get_Info (Spec));
- Chap4.Elab_Object_Value (Attr, Get_Expression (Spec));
- Clear_Info (Attr);
+ Chap3.Elab_Object_Subtype (Get_Type (Spec));
+ Chap4.Elab_Object_Value (Spec, Get_Expression (Spec));
end Elab_Attribute_Specification;
procedure Gen_Elab_Disconnect_Non_Composite (Targ : Mnode;