diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-07-31 17:17:00 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-08-02 08:01:36 +0200 |
commit | cdb323b1dbfccbcff5c63804ff73e6e86e4d05e8 (patch) | |
tree | 5886de13f70a7235dd8b114806d27614972c8bd0 /src/vhdl/evaluation.adb | |
parent | 55da78e95df865ba2e2048e6546e4fffcfe020da (diff) | |
download | ghdl-cdb323b1dbfccbcff5c63804ff73e6e86e4d05e8.tar.gz ghdl-cdb323b1dbfccbcff5c63804ff73e6e86e4d05e8.tar.bz2 ghdl-cdb323b1dbfccbcff5c63804ff73e6e86e4d05e8.zip |
Rewrite scan error messages: use formatting.
Diffstat (limited to 'src/vhdl/evaluation.adb')
-rw-r--r-- | src/vhdl/evaluation.adb | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/src/vhdl/evaluation.adb b/src/vhdl/evaluation.adb index e0b52fd9f..952f05cd0 100644 --- a/src/vhdl/evaluation.adb +++ b/src/vhdl/evaluation.adb @@ -560,8 +560,8 @@ package body Evaluation is exception when Constraint_Error => -- Can happen for absolute. - Warning_Msg_Sem ("arithmetic overflow in static expression", - Orig, Warnid_Runtime_Error); + Warning_Msg_Sem (Warnid_Runtime_Error, +Orig, + "arithmetic overflow in static expression"); return Build_Overflow (Orig); end Eval_Monadic_Operator; @@ -580,8 +580,8 @@ package body Evaluation is begin Len := Get_String_Length (Left); if Len /= Get_String_Length (Right) then - Warning_Msg_Sem ("length of left and right operands mismatch", - Expr, Warnid_Runtime_Error); + Warning_Msg_Sem (Warnid_Runtime_Error, +Expr, + "length of left and right operands mismatch"); return Build_Overflow (Expr); else Id := Create_String8; @@ -680,7 +680,7 @@ package body Evaluation is is begin if Get_Value (Val) = 0 then - Warning_Msg_Sem ("division by 0", Expr, Warnid_Runtime_Error); + Warning_Msg_Sem (Warnid_Runtime_Error, +Expr, "division by 0"); return False; else return True; @@ -1127,8 +1127,8 @@ package body Evaluation is (Get_Fp_Value (Left) * Get_Fp_Value (Right), Orig); when Iir_Predefined_Floating_Div => if Get_Fp_Value (Right) = 0.0 then - Warning_Msg_Sem ("right operand of division is 0", - Orig, Warnid_Runtime_Error); + Warning_Msg_Sem (Warnid_Runtime_Error, +Orig, + "right operand of division is 0"); return Build_Overflow (Orig); else return Build_Floating @@ -1455,8 +1455,8 @@ package body Evaluation is end case; exception when Constraint_Error => - Warning_Msg_Sem ("arithmetic overflow in static expression", - Orig, Warnid_Runtime_Error); + Warning_Msg_Sem (Warnid_Runtime_Error, +Orig, + "arithmetic overflow in static expression"); return Build_Overflow (Orig); end Eval_Dyadic_Operator; @@ -1649,8 +1649,9 @@ package body Evaluation is if Res /= Null_Iir then return Build_Constant (Res, Expr); else - Warning_Msg_Sem ("value """ & Value & """ not in enumeration " - & Disp_Node (Enum), Expr, Warnid_Runtime_Error); + Warning_Msg_Sem (Warnid_Runtime_Error, +Expr, + "value """ & Value & """ not in enumeration " + & Disp_Node (Enum)); return Build_Overflow (Expr); end if; end Build_Enumeration_Value; @@ -1723,9 +1724,9 @@ package body Evaluation is Unit := Get_Chain (Unit); end loop; if Unit = Null_Iir then - Warning_Msg_Sem ("Unit """ & UnitName (Sep + 1 .. UnitName'Last) - & """ not in physical type", - Expr, Warnid_Runtime_Error); + Warning_Msg_Sem (Warnid_Runtime_Error, +Expr, + "Unit """ & UnitName (Sep + 1 .. UnitName'Last) + & """ not in physical type"); return Build_Overflow (Expr); end if; @@ -1808,8 +1809,8 @@ package body Evaluation is (Get_Enumeration_Literal_List (Get_Base_Type (Get_Type (Expr)))))) then - Warning_Msg_Sem ("static constant violates bounds", - Expr, Warnid_Runtime_Error); + Warning_Msg_Sem (Warnid_Runtime_Error, +Expr, + "static constant violates bounds"); return Build_Overflow (Origin); else return Build_Enumeration (Iir_Index32 (P), Origin); @@ -1867,8 +1868,8 @@ package body Evaluation is if Get_Constraint_State (Conv_Type) = Fully_Constrained then Set_Type (Res, Conv_Type); if not Eval_Is_In_Bound (Val, Conv_Type) then - Warning_Msg_Sem ("non matching length in type conversion", - Conv, Warnid_Runtime_Error); + Warning_Msg_Sem (Warnid_Runtime_Error, +Conv, + "non matching length in type conversion"); return Build_Overflow (Conv); end if; return Res; @@ -1937,8 +1938,8 @@ package body Evaluation is end if; if not Eval_Is_In_Bound (Res, Get_Type (Expr)) then if Get_Kind (Res) /= Iir_Kind_Overflow_Literal then - Warning_Msg_Sem ("result of conversion out of bounds", - Expr, Warnid_Runtime_Error); + Warning_Msg_Sem (Warnid_Runtime_Error, +Expr, + "result of conversion out of bounds"); Res := Build_Overflow (Res); end if; end if; @@ -2124,8 +2125,8 @@ package body Evaluation is and then not Eval_Int_In_Range (Val, Get_Range_Constraint (Expr_Type)) then - Warning_Msg_Sem ("static argument out of the type range", - Expr, Warnid_Runtime_Error); + Warning_Msg_Sem (Warnid_Runtime_Error, +Expr, + "static argument out of the type range"); return Build_Overflow (Expr); end if; if Get_Kind (Get_Base_Type (Get_Type (Expr))) @@ -2173,8 +2174,8 @@ package body Evaluation is Set_Parameter (Expr, Param); if Get_Kind (Param) /= Iir_Kind_String_Literal8 then -- FIXME: Isn't it an implementation restriction. - Warning_Msg_Sem ("'value argument not a string", - Expr, Warnid_Runtime_Error); + Warning_Msg_Sem (Warnid_Runtime_Error, +Expr, + "'value argument not a string"); return Build_Overflow (Expr); else return Eval_Value_Attribute |