aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/sem_expr.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-09-19 02:32:16 +0200
committerTristan Gingold <tgingold@free.fr>2016-09-19 02:32:16 +0200
commit8c6e8db93f3ef85f7edf242d83c3e7e9af194636 (patch)
treeeb353ac4ba18040935973d15801420b8c0fe953f /src/vhdl/sem_expr.adb
parent62652e356f2e91d2317f5305a03f972385ba7ca1 (diff)
downloadghdl-8c6e8db93f3ef85f7edf242d83c3e7e9af194636.tar.gz
ghdl-8c6e8db93f3ef85f7edf242d83c3e7e9af194636.tar.bz2
ghdl-8c6e8db93f3ef85f7edf242d83c3e7e9af194636.zip
vhdl08: create interface subprogram declaration.
Diffstat (limited to 'src/vhdl/sem_expr.adb')
-rw-r--r--src/vhdl/sem_expr.adb43
1 files changed, 29 insertions, 14 deletions
diff --git a/src/vhdl/sem_expr.adb b/src/vhdl/sem_expr.adb
index e93532fb4..620931b24 100644
--- a/src/vhdl/sem_expr.adb
+++ b/src/vhdl/sem_expr.adb
@@ -915,20 +915,27 @@ package body Sem_Expr is
end case;
-- Staticness.
- case Get_Implicit_Definition (Imp) is
- when Iir_Predefined_Error =>
- raise Internal_Error;
- when Iir_Predefined_Pure_Functions =>
- null;
- when Iir_Predefined_Impure_Functions =>
- -- Predefined functions such as Now, Endfile are not static.
+ case Get_Kind (Imp) is
+ when Iir_Kind_Function_Declaration =>
+ case Get_Implicit_Definition (Imp) is
+ when Iir_Predefined_Error =>
+ raise Internal_Error;
+ when Iir_Predefined_Pure_Functions =>
+ null;
+ when Iir_Predefined_Impure_Functions =>
+ -- Predefined functions such as Now, Endfile are not static.
+ Staticness := None;
+ when Iir_Predefined_Explicit =>
+ if Get_Pure_Flag (Imp) then
+ Staticness := Min (Staticness, Globally);
+ else
+ Staticness := None;
+ end if;
+ end case;
+ when Iir_Kind_Interface_Function_Declaration =>
Staticness := None;
- when Iir_Predefined_Explicit =>
- if Get_Pure_Flag (Imp) then
- Staticness := Min (Staticness, Globally);
- else
- Staticness := None;
- end if;
+ when others =>
+ Error_Kind ("set_function_call_staticness", Imp);
end case;
Set_Expr_Staticness (Expr, Staticness);
end Set_Function_Call_Staticness;
@@ -1116,6 +1123,10 @@ package body Sem_Expr is
if Get_Purity_State (Callee) = Pure then
return;
end if;
+ when Iir_Kind_Interface_Function_Declaration
+ | Iir_Kind_Interface_Procedure_Declaration =>
+ -- FIXME: how to compute sensitivity ? Recurse ?
+ return;
when others =>
Error_Kind ("sem_call_all_sensitized_check", Callee);
end case;
@@ -1783,7 +1794,8 @@ package body Sem_Expr is
Decl := Get_Non_Alias_Declaration (Interpretation);
-- It is compatible with operand types ?
- pragma Assert (Get_Kind (Decl) = Iir_Kind_Function_Declaration);
+ pragma Assert (Kind_In (Decl, Iir_Kind_Function_Declaration,
+ Iir_Kind_Interface_Function_Declaration));
-- LRM08 12.3 Visibility
-- [...] or all visible declarations denote the same named entity.
@@ -3685,6 +3697,9 @@ package body Sem_Expr is
end if;
if Is_Anonymous_Type_Definition (Arg) then
Set_Allocator_Subtype (Expr, Get_Subtype_Indication (Expr));
+ Set_Is_Ref (Expr, True);
+ else
+ Set_Is_Ref (Expr, False);
end if;
-- LRM93 7.3.6