summaryrefslogtreecommitdiff
path: root/src/vhdl/sem_names.adb
diff options
context:
space:
mode:
authorTristan Gingold2015-08-29 07:57:12 +0200
committerTristan Gingold2015-08-29 07:57:12 +0200
commitb75d703676ab830ea3e5731e1965d1d89879a456 (patch)
tree1a0a21ba1cce6385715bd2823853ee4ad47905ee /src/vhdl/sem_names.adb
parent64fa65e1395bef4f05c51bc19d9a46d6003339ee (diff)
downloadghdl-b75d703676ab830ea3e5731e1965d1d89879a456.tar.gz
ghdl-b75d703676ab830ea3e5731e1965d1d89879a456.tar.bz2
ghdl-b75d703676ab830ea3e5731e1965d1d89879a456.zip
Replace fat accesses by bounds accesses
translate: separate info for signals from object. Improve some error messages.
Diffstat (limited to 'src/vhdl/sem_names.adb')
-rw-r--r--src/vhdl/sem_names.adb70
1 files changed, 5 insertions, 65 deletions
diff --git a/src/vhdl/sem_names.adb b/src/vhdl/sem_names.adb
index d6e3422..fca9f4f 100644
--- a/src/vhdl/sem_names.adb
+++ b/src/vhdl/sem_names.adb
@@ -2205,7 +2205,7 @@ package body Sem_Names is
-- Only values can be indexed or sliced.
-- Catch errors such as slice of a type conversion.
- if not Is_Object_Name (Sub_Name)
+ if Name_To_Value (Sub_Name) = Null_Iir
and then Get_Kind (Sub_Name) /= Iir_Kind_Function_Declaration
then
if Finish then
@@ -2492,6 +2492,10 @@ package body Sem_Names is
when Iir_Kinds_Library_Unit_Declaration =>
Error_Msg_Sem ("function name is a design unit", Name);
+ when Iir_Kind_Error =>
+ -- Continue with the error.
+ Res := Prefix;
+
when others =>
Error_Kind ("sem_parenthesis_name", Prefix);
end case;
@@ -3774,70 +3778,6 @@ package body Sem_Names is
end case;
end Name_To_Range;
- function Is_Object_Name (Name : Iir) return Boolean is
- begin
- case Get_Kind (Name) is
- when Iir_Kind_Object_Alias_Declaration
- | Iir_Kind_Signal_Declaration
- | Iir_Kind_Guard_Signal_Declaration
- | Iir_Kind_Variable_Declaration
- | Iir_Kind_File_Declaration
- | Iir_Kind_Constant_Declaration
- | Iir_Kind_Iterator_Declaration
- | Iir_Kind_Interface_Constant_Declaration
- | Iir_Kind_Interface_Variable_Declaration
- | Iir_Kind_Interface_Signal_Declaration
- | Iir_Kind_Interface_File_Declaration
- | Iir_Kind_Slice_Name
- | Iir_Kind_Indexed_Name
- | Iir_Kind_Selected_Element
- | Iir_Kind_Implicit_Dereference
- | Iir_Kind_Dereference
- | Iir_Kind_Attribute_Value
- | Iir_Kind_Function_Call =>
- return True;
- when Iir_Kinds_Expression_Attribute =>
- -- All expression attributes are a name.
- return True;
- when Iir_Kind_Simple_Name
- | Iir_Kind_Selected_Name =>
- return False;
- when others =>
- return False;
- end case;
- end Is_Object_Name;
-
- function Name_To_Object (Name : Iir) return Iir is
- begin
- case Get_Kind (Name) is
- when Iir_Kind_Object_Alias_Declaration
- | Iir_Kind_Signal_Declaration
- | Iir_Kind_Guard_Signal_Declaration
- | Iir_Kind_Variable_Declaration
- | Iir_Kind_File_Declaration
- | Iir_Kind_Constant_Declaration
- | Iir_Kind_Iterator_Declaration
- | Iir_Kind_Interface_Constant_Declaration
- | Iir_Kind_Interface_Variable_Declaration
- | Iir_Kind_Interface_Signal_Declaration
- | Iir_Kind_Interface_File_Declaration
- | Iir_Kind_Slice_Name
- | Iir_Kind_Indexed_Name
- | Iir_Kind_Selected_Element
- | Iir_Kind_Implicit_Dereference
- | Iir_Kind_Dereference
- | Iir_Kind_Attribute_Value
- | Iir_Kind_Function_Call
- | Iir_Kinds_Signal_Attribute =>
- return Name;
- when Iir_Kind_Simple_Name
- | Iir_Kind_Selected_Name =>
- return Name_To_Object (Get_Named_Entity (Name));
- when others =>
- return Null_Iir;
- end case;
- end Name_To_Object;
-
function Create_Error_Name (Orig : Iir) return Iir
is
Res : Iir;