diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-10-01 07:53:19 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-10-01 07:53:19 +0200 |
commit | d5702f01058dc85caca2538c456717abab2d18f8 (patch) | |
tree | 140018270181c02de337ef963a97ca18af76ed0c /src/vhdl/sem_names.adb | |
parent | 5aa2650481c681e40f5d20997cd90f56ae0cdcd0 (diff) | |
download | ghdl-d5702f01058dc85caca2538c456717abab2d18f8.tar.gz ghdl-d5702f01058dc85caca2538c456717abab2d18f8.tar.bz2 ghdl-d5702f01058dc85caca2538c456717abab2d18f8.zip |
Minor refactoruing.
Diffstat (limited to 'src/vhdl/sem_names.adb')
-rw-r--r-- | src/vhdl/sem_names.adb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/vhdl/sem_names.adb b/src/vhdl/sem_names.adb index fdee1c1e2..6fe3f47d9 100644 --- a/src/vhdl/sem_names.adb +++ b/src/vhdl/sem_names.adb @@ -870,18 +870,18 @@ package body Sem_Names is if Get_Kind (Res) in Iir_Kinds_Denoting_Name then -- Common correct case. Atype := Get_Named_Entity (Res); - if Get_Kind (Atype) = Iir_Kind_Type_Declaration then - Atype := Get_Type_Definition (Atype); - elsif Get_Kind (Atype) = Iir_Kind_Subtype_Declaration - or else Get_Kind (Atype) = Iir_Kind_Interface_Type_Declaration - then - Atype := Get_Type (Atype); - else - Error_Msg_Sem - (+Name, "a type mark must denote a type or a subtype"); - Atype := Create_Error_Type (Atype); - Set_Named_Entity (Res, Atype); - end if; + case Get_Kind (Atype) is + when Iir_Kind_Type_Declaration => + Atype := Get_Type_Definition (Atype); + when Iir_Kind_Subtype_Declaration + | Iir_Kind_Interface_Type_Declaration => + Atype := Get_Type (Atype); + when others => + Error_Msg_Sem + (+Name, "a type mark must denote a type or a subtype"); + Atype := Create_Error_Type (Atype); + Set_Named_Entity (Res, Atype); + end case; else if Get_Kind (Res) /= Iir_Kind_Error then Error_Msg_Sem |