diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-05-09 21:15:08 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-05-09 21:16:26 +0200 |
commit | 097a610b153d32ea42c7ba2fc293a2f14989d4a3 (patch) | |
tree | 2c067851da2f66ae0c6f77c37c34768beb557da1 | |
parent | bbf6274904efe5bde340b50f5795520872924404 (diff) | |
download | ghdl-097a610b153d32ea42c7ba2fc293a2f14989d4a3.tar.gz ghdl-097a610b153d32ea42c7ba2fc293a2f14989d4a3.tar.bz2 ghdl-097a610b153d32ea42c7ba2fc293a2f14989d4a3.zip |
Improve cascaded errors on instantiation.
-rw-r--r-- | src/vhdl/sem.adb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/vhdl/sem.adb b/src/vhdl/sem.adb index 24c991a45..5ee8e8da1 100644 --- a/src/vhdl/sem.adb +++ b/src/vhdl/sem.adb @@ -2814,16 +2814,14 @@ package body Sem is Name := Sem_Denoting_Name (Get_Uninstantiated_Package_Name (Decl)); Set_Uninstantiated_Package_Name (Decl, Name); Pkg := Get_Named_Entity (Name); - if Get_Kind (Pkg) /= Iir_Kind_Package_Declaration then + if Is_Error (Pkg) then + null; + elsif Get_Kind (Pkg) /= Iir_Kind_Package_Declaration then Error_Class_Match (Name, "package"); - - -- What could be done ? - return Null_Iir; + Pkg := Create_Error (Pkg); elsif not Is_Uninstantiated_Package (Pkg) then Error_Msg_Sem (+Name, "%n is not an uninstantiated package", +Pkg); - - -- What could be done ? - return Null_Iir; + Pkg := Create_Error (Pkg); end if; Set_Uninstantiated_Package_Decl (Decl, Pkg); @@ -2846,7 +2844,7 @@ package body Sem is -- The uninstantiated package name shall denote an uninstantiated -- package declared in a package declaration. Pkg := Sem_Uninstantiated_Package_Name (Decl); - if Pkg = Null_Iir then + if Pkg = Null_Iir or Is_Error (Pkg) then -- What could be done ? return; end if; |