aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-12-30 06:29:33 +0100
committerTristan Gingold <tgingold@free.fr>2019-12-30 06:29:33 +0100
commita0d0ec1e5a622b64d0655a3206079325f4a53302 (patch)
tree96d3eaaa824c1388bd7856f0f668037ba2c1b93e /src
parent8eda0ff3ed3656336ca918983e3a2df5e0276d18 (diff)
downloadghdl-a0d0ec1e5a622b64d0655a3206079325f4a53302.tar.gz
ghdl-a0d0ec1e5a622b64d0655a3206079325f4a53302.tar.bz2
ghdl-a0d0ec1e5a622b64d0655a3206079325f4a53302.zip
ams-vhdl: correctly test and set staticness of dot/integ attributes.
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/vhdl-sem_names.adb15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/vhdl/vhdl-sem_names.adb b/src/vhdl/vhdl-sem_names.adb
index daee2e068..6f7159656 100644
--- a/src/vhdl/vhdl-sem_names.adb
+++ b/src/vhdl/vhdl-sem_names.adb
@@ -1861,7 +1861,8 @@ package body Vhdl.Sem_Names is
return Res;
when Iir_Kind_Dot_Attribute
| Iir_Kind_Integ_Attribute =>
- null;
+ -- Already finished.
+ return Res;
when Iir_Kinds_Type_Attribute
| Iir_Kind_Base_Attribute =>
pragma Assert (Get_Kind (Name) = Iir_Kind_Attribute_Name);
@@ -1916,9 +1917,7 @@ package body Vhdl.Sem_Names is
| Iir_Kind_Subtype_Attribute
| Iir_Kind_Through_Attribute
| Iir_Kind_Across_Attribute
- | Iir_Kind_Nature_Reference_Attribute
- | Iir_Kind_Dot_Attribute
- | Iir_Kind_Integ_Attribute =>
+ | Iir_Kind_Nature_Reference_Attribute =>
Sem_Name_Free_Result (Name, Res);
when others =>
Error_Kind ("finish_sem_name_1(2)", Res);
@@ -3959,15 +3958,15 @@ package body Vhdl.Sem_Names is
function Sem_Quantity_Attribute (Attr : Iir_Attribute_Name) return Iir
is
use Std_Names;
- Prefix_Name : constant Iir := Get_Prefix (Attr);
+ Name_Prefix : constant Iir := Get_Prefix (Attr);
Prefix: Iir;
Res : Iir;
begin
- Prefix := Get_Named_Entity (Prefix_Name);
+ Prefix := Get_Named_Entity (Name_Prefix);
+ Prefix := Finish_Sem_Name_1 (Name_Prefix, Prefix);
if not Is_Quantity_Name (Prefix) then
Error_Msg_Sem
(+Attr, "prefix of %i attribute must denote a quantity", +Attr);
- return Error_Mark;
end if;
case Get_Identifier (Attr) is
@@ -3992,7 +3991,7 @@ package body Vhdl.Sem_Names is
-- Prefix: Any quantity denoted by the static name Q.
if Get_Name_Staticness (Prefix) < Globally then
Error_Msg_Sem
- (+Attr, "prefix of %i attribute must be a static name", +Attr);
+ (+Res, "prefix of %i attribute must be a static name", +Res);
end if;
-- According to LRM 7.4, signal attributes are not static expressions