diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-06-12 18:41:24 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-06-12 18:41:24 +0200 |
commit | 6f25e8dff808b37013cf6fa0cb2868e8a85caa79 (patch) | |
tree | 7ef0495b0eadec2d5aa39bf6994ce15d34eb4b0c /src/vhdl | |
parent | 4b4c2f03f79dbd7a9b9138371440117a514644ce (diff) | |
download | ghdl-6f25e8dff808b37013cf6fa0cb2868e8a85caa79.tar.gz ghdl-6f25e8dff808b37013cf6fa0cb2868e8a85caa79.tar.bz2 ghdl-6f25e8dff808b37013cf6fa0cb2868e8a85caa79.zip |
vhdl: improve error messages for generate statement.
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/vhdl-errors.adb | 2 | ||||
-rw-r--r-- | src/vhdl/vhdl-sem_expr.adb | 4 | ||||
-rw-r--r-- | src/vhdl/vhdl-sem_stmts.adb | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/src/vhdl/vhdl-errors.adb b/src/vhdl/vhdl-errors.adb index 541415cd7..1bed01213 100644 --- a/src/vhdl/vhdl-errors.adb +++ b/src/vhdl/vhdl-errors.adb @@ -958,7 +958,7 @@ package body Vhdl.Errors is procedure Error_Not_Match (Expr: Iir; A_Type: Iir) is begin - if Get_Kind (A_Type) = Iir_Kind_Error then + if Is_Error (A_Type) then -- Cascade error message. return; end if; diff --git a/src/vhdl/vhdl-sem_expr.adb b/src/vhdl/vhdl-sem_expr.adb index da499d449..8bb2ad324 100644 --- a/src/vhdl/vhdl-sem_expr.adb +++ b/src/vhdl/vhdl-sem_expr.adb @@ -4928,7 +4928,9 @@ package body Vhdl.Sem_Expr is if A_Type /= Null_Iir and then Are_Types_Compatible (Expr_Type, A_Type) = Not_Compatible then - Error_Not_Match (Expr, A_Type); + if not Is_Error (Expr_Type) then + Error_Not_Match (Expr, A_Type); + end if; return Null_Iir; end if; return Expr; diff --git a/src/vhdl/vhdl-sem_stmts.adb b/src/vhdl/vhdl-sem_stmts.adb index f8a42f182..26f412c62 100644 --- a/src/vhdl/vhdl-sem_stmts.adb +++ b/src/vhdl/vhdl-sem_stmts.adb @@ -1741,7 +1741,7 @@ package body Vhdl.Sem_Stmts is -- LRM93 9.7 -- The discrete range in a generation scheme of the first form must -- be a static discrete range; - if Get_Type (Param) /= Null_Iir + if not Is_Error (Get_Type (Param)) and then Get_Type_Staticness (Get_Type (Param)) < Globally then Error_Msg_Sem (+Stmt, "range must be a static discrete range"); |