diff options
-rw-r--r-- | src/logging.ads | 1 | ||||
-rw-r--r-- | src/vhdl/errorout.adb | 36 |
2 files changed, 14 insertions, 23 deletions
diff --git a/src/logging.ads b/src/logging.ads index faf802193..74471b918 100644 --- a/src/logging.ads +++ b/src/logging.ads @@ -17,6 +17,7 @@ -- 02111-1307, USA. package Logging is + -- Crude: log on standard error. procedure Log (S : String); procedure Log_Line (S : String := ""); end Logging; diff --git a/src/vhdl/errorout.adb b/src/vhdl/errorout.adb index 24b0f5493..cdeb28ee4 100644 --- a/src/vhdl/errorout.adb +++ b/src/vhdl/errorout.adb @@ -16,7 +16,7 @@ -- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- 02111-1307, USA. -with Ada.Text_IO; +with Logging; use Logging; with Scanner; with Name_Table; with Iirs_Utils; use Iirs_Utils; @@ -28,35 +28,26 @@ with PSL.Nodes; with Str_Table; package body Errorout is - procedure Error_Kind (Msg : String; An_Iir : Iir) - is - use Ada.Text_IO; + procedure Error_Kind (Msg : String; An_Iir : Iir) is begin - Put_Line - (Standard_Error, - Msg & ": cannot handle " & Iir_Kind'Image (Get_Kind (An_Iir)) + Log_Line + (Msg & ": cannot handle " & Iir_Kind'Image (Get_Kind (An_Iir)) & " (" & Disp_Location (An_Iir) & ')'); raise Internal_Error; end Error_Kind; - procedure Error_Kind (Msg : String; Def : Iir_Predefined_Functions) - is - use Ada.Text_IO; + procedure Error_Kind (Msg : String; Def : Iir_Predefined_Functions) is begin - Put_Line - (Standard_Error, - Msg & ": cannot handle " & Iir_Predefined_Functions'Image (Def)); + Log_Line + (Msg & ": cannot handle " & Iir_Predefined_Functions'Image (Def)); raise Internal_Error; end Error_Kind; - procedure Error_Kind (Msg : String; N : PSL_Node) - is - use Ada.Text_IO; + procedure Error_Kind (Msg : String; N : PSL_Node) is begin - Put (Standard_Error, Msg); - Put (Standard_Error, ": cannot handle "); - Put_Line (Standard_Error, - PSL.Nodes.Nkind'Image (PSL.Nodes.Get_Kind (N))); + Log (Msg); + Log (": cannot handle "); + Log_Line (PSL.Nodes.Nkind'Image (PSL.Nodes.Get_Kind (N))); raise Internal_Error; end Error_Kind; @@ -591,11 +582,10 @@ package body Errorout is -- Disp a bug message. procedure Error_Internal (Expr: in Iir; Msg: String := "") is - use Ada.Text_IO; pragma Unreferenced (Expr); begin - Put (Standard_Error, "internal error: "); - Put_Line (Standard_Error, Msg); + Log ("internal error: "); + Log_Line (Msg); raise Internal_Error; end Error_Internal; |