aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-01-17 06:53:01 +0100
committerTristan Gingold <tgingold@free.fr>2016-01-19 19:54:40 +0100
commit1e2aeb2a4635f24c60384232e319b682b0d99f3c (patch)
treef0717eb0065cc1adbd397e69957959826d809a81
parent8e2468448947c7e1567cc50035a483c2ebd7b9d9 (diff)
downloadghdl-1e2aeb2a4635f24c60384232e319b682b0d99f3c.tar.gz
ghdl-1e2aeb2a4635f24c60384232e319b682b0d99f3c.tar.bz2
ghdl-1e2aeb2a4635f24c60384232e319b682b0d99f3c.zip
Clean up some code and comments about constant declarations.
-rw-r--r--src/vhdl/iirs.ads8
-rw-r--r--src/vhdl/nodes_meta.adb4
-rw-r--r--src/vhdl/sem_decls.adb5
-rw-r--r--src/vhdl/sem_expr.adb6
4 files changed, 6 insertions, 17 deletions
diff --git a/src/vhdl/iirs.ads b/src/vhdl/iirs.ads
index cc7eb83f0..56a1794a9 100644
--- a/src/vhdl/iirs.ads
+++ b/src/vhdl/iirs.ads
@@ -1435,9 +1435,9 @@ package Iirs is
--
-- Only for Iir_Kind_Constant_Declaration:
-- Summary:
- -- | constant C1 : integer; -- Deferred declaration (in a package)
- -- | constant C2 : integer := 4; -- Declaration
- -- | constant C1 : integer := 3; -- Full declaration (in a body)
+ -- | constant C1 : integer; -- Deferred declaration (in a package)
+ -- | constant C2 : integer := 4; -- Declaration
+ -- | constant C1 : integer := 3; -- Full declaration (in a body)
-- | NAME Deferred_declaration Deferred_declaration_flag
-- | C1 Null_iir or C1' (*) True
-- | C2 Null_Iir False
@@ -5656,7 +5656,7 @@ package Iirs is
-- declaration for a full constant declaration, or is null_iir for a
-- usual or deferred constant declaration.
-- Set only during sem.
- -- Field: Field6
+ -- Field: Field6 Ref
function Get_Deferred_Declaration (Target : Iir) return Iir;
procedure Set_Deferred_Declaration (Target : Iir; Decl : Iir);
diff --git a/src/vhdl/nodes_meta.adb b/src/vhdl/nodes_meta.adb
index 6c2ccd506..c1725ea40 100644
--- a/src/vhdl/nodes_meta.adb
+++ b/src/vhdl/nodes_meta.adb
@@ -1646,7 +1646,7 @@ package body Nodes_Meta is
when Field_Default_Value =>
return Attr_Maybe_Ref;
when Field_Deferred_Declaration =>
- return Attr_None;
+ return Attr_Ref;
when Field_Deferred_Declaration_Flag =>
return Attr_None;
when Field_Shared_Flag =>
@@ -2923,11 +2923,11 @@ package body Nodes_Meta is
Field_Expr_Staticness,
Field_Name_Staticness,
Field_Chain,
- Field_Deferred_Declaration,
Field_Default_Value,
Field_Subtype_Indication,
Field_Parent,
Field_Type,
+ Field_Deferred_Declaration,
-- Iir_Kind_Iterator_Declaration
Field_Identifier,
Field_Has_Identifier_List,
diff --git a/src/vhdl/sem_decls.adb b/src/vhdl/sem_decls.adb
index a155b6f94..f70566ace 100644
--- a/src/vhdl/sem_decls.adb
+++ b/src/vhdl/sem_decls.adb
@@ -3042,11 +3042,6 @@ package body Sem_Decls is
if Get_Deferred_Declaration (El) = Null_Iir then
Error_Msg_Sem ("missing value for constant declared at "
& Disp_Location (El), Decl);
- else
- -- Remove from visibility the full declaration of the
- -- constant.
- -- FIXME: this is not a check!
- Set_Deferred_Declaration (El, Null_Iir);
end if;
end if;
when Iir_Kind_Function_Declaration
diff --git a/src/vhdl/sem_expr.adb b/src/vhdl/sem_expr.adb
index df2f68dcd..5568905a5 100644
--- a/src/vhdl/sem_expr.adb
+++ b/src/vhdl/sem_expr.adb
@@ -3993,12 +3993,6 @@ package body Sem_Expr is
end if;
Lib := Get_Parent (Expr);
- if Get_Kind (Lib) = Iir_Kind_Design_Unit then
- Lib := Get_Library_Unit (Lib);
- -- FIXME: the parent of the constant is the library unit or
- -- the design unit ?
- raise Internal_Error;
- end if;
Cur_Lib := Get_Library_Unit (Sem.Get_Current_Design_Unit);
if (Get_Kind (Cur_Lib) = Iir_Kind_Package_Declaration
and then Lib = Cur_Lib)