summaryrefslogtreecommitdiff
path: root/src/vhdl/sem_decls.adb
diff options
context:
space:
mode:
authorTristan Gingold2015-05-12 22:42:22 +0200
committerTristan Gingold2015-05-12 22:42:22 +0200
commit1c8b894c429a29a34ac251c5536ececd18bac048 (patch)
tree48d3b8676dca17ed033aa90960f64fad0c6762ea /src/vhdl/sem_decls.adb
parent4c4d44d92d418ab5cc019b2851990543fcf8f428 (diff)
downloadghdl-1c8b894c429a29a34ac251c5536ececd18bac048.tar.gz
ghdl-1c8b894c429a29a34ac251c5536ececd18bac048.tar.bz2
ghdl-1c8b894c429a29a34ac251c5536ececd18bac048.zip
Always report pure rules violation, but as a warning in 93c or -frelaxed-rules
For ticket 57.
Diffstat (limited to 'src/vhdl/sem_decls.adb')
-rw-r--r--src/vhdl/sem_decls.adb48
1 files changed, 23 insertions, 25 deletions
diff --git a/src/vhdl/sem_decls.adb b/src/vhdl/sem_decls.adb
index c7b26cc..8d79338 100644
--- a/src/vhdl/sem_decls.adb
+++ b/src/vhdl/sem_decls.adb
@@ -1894,31 +1894,29 @@ package body Sem_Decls is
-- Note: this check is also performed when a file is referenced.
-- But a file can be declared without being explicitly referenced.
- if Flags.Vhdl_Std > Vhdl_93c then
- declare
- Parent : Iir;
- Spec : Iir;
- begin
- Parent := Get_Parent (Decl);
- case Get_Kind (Parent) is
- when Iir_Kind_Function_Body =>
- Spec := Get_Subprogram_Specification (Parent);
- if Get_Pure_Flag (Spec) then
- Error_Msg_Sem
- ("cannot declare a file in a pure function", Decl);
- end if;
- when Iir_Kind_Procedure_Body =>
- Spec := Get_Subprogram_Specification (Parent);
- Set_Purity_State (Spec, Impure);
- Set_Impure_Depth (Parent, Iir_Depth_Impure);
- when Iir_Kind_Function_Declaration
- | Iir_Kind_Procedure_Declaration =>
- Error_Kind ("sem_file_declaration", Parent);
- when others =>
- null;
- end case;
- end;
- end if;
+ declare
+ Parent : Iir;
+ Spec : Iir;
+ begin
+ Parent := Get_Parent (Decl);
+ case Get_Kind (Parent) is
+ when Iir_Kind_Function_Body =>
+ Spec := Get_Subprogram_Specification (Parent);
+ if Get_Pure_Flag (Spec) then
+ Error_Msg_Sem_Relaxed
+ ("cannot declare a file in a pure function", Decl);
+ end if;
+ when Iir_Kind_Procedure_Body =>
+ Spec := Get_Subprogram_Specification (Parent);
+ Set_Purity_State (Spec, Impure);
+ Set_Impure_Depth (Parent, Iir_Depth_Impure);
+ when Iir_Kind_Function_Declaration
+ | Iir_Kind_Procedure_Declaration =>
+ Error_Kind ("sem_file_declaration", Parent);
+ when others =>
+ null;
+ end case;
+ end;
end Sem_File_Declaration;
procedure Sem_Attribute_Declaration (Decl: Iir_Attribute_Declaration)