aboutsummaryrefslogtreecommitdiffstats
path: root/sem_decls.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2014-01-08 04:22:40 +0100
committerTristan Gingold <tgingold@free.fr>2014-01-08 04:22:40 +0100
commit19211ffc421560405aee966ee742ae849c73a31c (patch)
tree1036f20b80fd8133c94fccb8e4ff6a9cc226818d /sem_decls.adb
parent429a5e4a2d7714915b45b33869f06f954c29a316 (diff)
downloadghdl-19211ffc421560405aee966ee742ae849c73a31c.tar.gz
ghdl-19211ffc421560405aee966ee742ae849c73a31c.tar.bz2
ghdl-19211ffc421560405aee966ee742ae849c73a31c.zip
Rework literal typing (and initial work for condition operator).
Diffstat (limited to 'sem_decls.adb')
-rw-r--r--sem_decls.adb13
1 files changed, 8 insertions, 5 deletions
diff --git a/sem_decls.adb b/sem_decls.adb
index 83d2448f2..ffe80d566 100644
--- a/sem_decls.adb
+++ b/sem_decls.adb
@@ -1129,8 +1129,6 @@ package body Sem_Decls is
Sem_Scopes.Name_Visible (St_Decl);
- Sem_Scopes.Add_Visible_Type (Decl);
-
-- The implicit subprogram will be added in the
-- scope just after.
Create_Implicit_Operations (Decl, False);
@@ -1144,7 +1142,6 @@ package body Sem_Decls is
Set_Type_Declarator (Def, Decl);
Sem_Scopes.Name_Visible (Decl);
- Sem_Scopes.Add_Visible_Type (Decl);
-- The implicit subprogram will be added in the
-- scope just after.
@@ -1152,7 +1149,6 @@ package body Sem_Decls is
when Iir_Kind_Protected_Type_Declaration =>
Set_Type_Declarator (Def, Decl);
- Sem_Scopes.Add_Visible_Type (Decl);
St_Decl := Null_Iir;
-- No implicit subprograms.
@@ -1280,7 +1276,9 @@ package body Sem_Decls is
end if;
if Deferred_Const = Null_Iir then
- Sem_Scopes.Add_Name (Decl);
+ if not Flag_Relaxed_Rules then
+ Sem_Scopes.Add_Name (Decl);
+ end if;
Xref_Decl (Decl);
else
Xref_Ref (Decl, Deferred_Const);
@@ -1306,6 +1304,11 @@ package body Sem_Decls is
Check_Read (Default_Value);
end if;
end if;
+
+ if Deferred_Const = Null_Iir and Flag_Relaxed_Rules then
+ Sem_Scopes.Add_Name (Decl);
+ end if;
+
Set_Type (Decl, Atype);
Default_Value := Eval_Expr_Check_If_Static (Default_Value, Atype);
Set_Default_Value (Decl, Default_Value);