summaryrefslogtreecommitdiff
path: root/src/vhdl/sem_names.adb
diff options
context:
space:
mode:
authorTristan Gingold2015-05-23 08:01:30 +0200
committerTristan Gingold2015-05-23 08:01:30 +0200
commitb8a48a6144a988904867fb044fbe2cb9f7d2750a (patch)
tree1ad4dd9eb9d685e4d86e734291bdcda94b68f7a6 /src/vhdl/sem_names.adb
parent6d809ee2e64d5033b62db219f86707e30babe381 (diff)
downloadghdl-b8a48a6144a988904867fb044fbe2cb9f7d2750a.tar.gz
ghdl-b8a48a6144a988904867fb044fbe2cb9f7d2750a.tar.bz2
ghdl-b8a48a6144a988904867fb044fbe2cb9f7d2750a.zip
Preliminary work to support external names (parse, semantic)
Diffstat (limited to 'src/vhdl/sem_names.adb')
-rw-r--r--src/vhdl/sem_names.adb19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/vhdl/sem_names.adb b/src/vhdl/sem_names.adb
index 66bd048..478499d 100644
--- a/src/vhdl/sem_names.adb
+++ b/src/vhdl/sem_names.adb
@@ -2415,6 +2415,7 @@ package body Sem_Names is
| Iir_Kind_Implicit_Dereference
| Iir_Kind_Selected_Element
| Iir_Kind_Attribute_Value
+ | Iir_Kind_Simple_Name_Attribute
| Iir_Kind_Function_Call =>
Add_Result (Res, Sem_As_Indexed_Or_Slice_Name (Prefix, True));
@@ -3883,6 +3884,24 @@ package body Sem_Names is
end case;
end Sem_Denoting_Name;
+ procedure Sem_External_Name (Name : Iir)
+ is
+ Atype : Iir;
+ begin
+ pragma Assert (Get_Type (Name) = Null_Iir);
+
+ Atype := Get_Subtype_Indication (Name);
+
+ Atype := Sem_Types.Sem_Subtype_Indication (Atype);
+ Set_Subtype_Indication (Name, Atype);
+ Atype := Get_Type_Of_Subtype_Indication (Atype);
+ if Atype = Null_Iir then
+ Atype := Create_Error_Type (Null_Iir);
+ end if;
+
+ Set_Type (Name, Atype);
+ end Sem_External_Name;
+
function Sem_Terminal_Name (Name : Iir) return Iir
is
Res : Iir;