aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/iirs.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-10-18 02:31:27 +0200
committerTristan Gingold <tgingold@free.fr>2016-10-18 02:36:56 +0200
commitdb113af86a8a7fc04775d585feb2b7b432212368 (patch)
treefe8e8b349923a3adbaa9a24a49ce2300c5a6f863 /src/vhdl/iirs.adb
parentb42b707e1f1977abe82d0d6a8ecce5fbee38faa8 (diff)
downloadghdl-db113af86a8a7fc04775d585feb2b7b432212368.tar.gz
ghdl-db113af86a8a7fc04775d585feb2b7b432212368.tar.bz2
ghdl-db113af86a8a7fc04775d585feb2b7b432212368.zip
iirs: add an assert on Get_Kind.
Diffstat (limited to 'src/vhdl/iirs.adb')
-rw-r--r--src/vhdl/iirs.adb7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vhdl/iirs.adb b/src/vhdl/iirs.adb
index 4db20bded..db662b8bb 100644
--- a/src/vhdl/iirs.adb
+++ b/src/vhdl/iirs.adb
@@ -124,18 +124,19 @@ package body Iirs is
return Res;
end Create_Iir_Error;
- procedure Location_Copy (Target: Iir; Src: Iir) is
+ procedure Location_Copy (Target : Iir; Src : Iir) is
begin
Set_Location (Target, Get_Location (Src));
end Location_Copy;
-- Get kind
- function Get_Kind (An_Iir: Iir) return Iir_Kind
+ function Get_Kind (N : Iir) return Iir_Kind
is
-- Speed up: avoid to check that nkind is in the bounds of Iir_Kind.
pragma Suppress (Range_Check);
begin
- return Iir_Kind'Val (Get_Nkind (An_Iir));
+ pragma Assert (N /= Null_Iir);
+ return Iir_Kind'Val (Get_Nkind (N));
end Get_Kind;
function Time_Stamp_Id_To_Iir is new Ada.Unchecked_Conversion