diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-02-18 05:38:35 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-02-21 04:47:55 +0100 |
commit | 4f237c5199bcf7ee7f75996588b91b36f23f16ca (patch) | |
tree | bcba02adc2b243f2882ebc2f3cd34c6ddc3a48a1 /src/vhdl | |
parent | 663ebfd4f5f6d6143126e1900255decd6aef0b29 (diff) | |
download | ghdl-4f237c5199bcf7ee7f75996588b91b36f23f16ca.tar.gz ghdl-4f237c5199bcf7ee7f75996588b91b36f23f16ca.tar.bz2 ghdl-4f237c5199bcf7ee7f75996588b91b36f23f16ca.zip |
Disable warnings while analyzing dependences.
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/errorout.adb | 31 | ||||
-rw-r--r-- | src/vhdl/errorout.ads | 23 |
2 files changed, 41 insertions, 13 deletions
diff --git a/src/vhdl/errorout.adb b/src/vhdl/errorout.adb index a0b279752..f65cb555f 100644 --- a/src/vhdl/errorout.adb +++ b/src/vhdl/errorout.adb @@ -85,19 +85,7 @@ package body Errorout is -- Warnings. - type Warning_Control_Type is record - Enabled : Boolean; - Error : Boolean; - end record; - - type Warnings_Array is array (Msgid_Warnings) of Warning_Control_Type; - - Warnings_Control : Warnings_Array := - (Warnid_Binding - | Warnid_Library => (Enabled => True, Error => False), - Warnid_Shared - | Warnid_Pure => (Enabled => True, Error => False), - others => (Enabled => False, Error => False)); + Warnings_Control : Warnings_Setting := Default_Warnings; procedure Enable_Warning (Id : Msgid_Warnings; Enable : Boolean) is begin @@ -137,6 +125,23 @@ package body Errorout is return Res; end Warning_Image; + procedure Save_Warnings_Setting (Res : out Warnings_Setting) is + begin + Res := Warnings_Control; + end Save_Warnings_Setting; + + procedure Disable_All_Warnings is + begin + Warnings_Control := (others => (Enabled => False, Error => False)); + end Disable_All_Warnings; + + procedure Restore_Warnings_Setting (Res : Warnings_Setting) is + begin + Warnings_Control := Res; + end Restore_Warnings_Setting; + + -- Error arguments + function "+" (V : Iir) return Earg_Type is begin return (Kind => Earg_Iir, Val_Iir => V); diff --git a/src/vhdl/errorout.ads b/src/vhdl/errorout.ads index 417ea9077..09260a876 100644 --- a/src/vhdl/errorout.ads +++ b/src/vhdl/errorout.ads @@ -125,6 +125,15 @@ package Errorout is -- Get enable status of a warning. function Is_Warning_Enabled (Id : Msgid_Warnings) return Boolean; + -- State of warnings. + type Warnings_Setting is private; + + -- Global control of warnings. + -- Used to disable warnings while a referenced unit is analyzed. + procedure Save_Warnings_Setting (Res : out Warnings_Setting); + procedure Disable_All_Warnings; + procedure Restore_Warnings_Setting (Res : Warnings_Setting); + type Earg_Type is private; type Earg_Arr is array (Natural range <>) of Earg_Type; @@ -310,4 +319,18 @@ private end record; No_Eargs : constant Earg_Arr := (1 .. 0 => (Kind => Earg_None)); + + type Warning_Control_Type is record + Enabled : Boolean; + Error : Boolean; + end record; + + type Warnings_Setting is array (Msgid_Warnings) of Warning_Control_Type; + + Default_Warnings : constant Warnings_Setting := + (Warnid_Binding + | Warnid_Library => (Enabled => True, Error => False), + Warnid_Shared + | Warnid_Pure => (Enabled => True, Error => False), + others => (Enabled => False, Error => False)); end Errorout; |