From bc3a8ec174f84cd8f1b13304a9b2d4f3a7bcfdf0 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 25 Jan 2023 08:14:39 +0100 Subject: errorout: add int64 arguments --- src/errorout.adb | 23 +++++++++++++++++++++++ src/errorout.ads | 5 ++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/errorout.adb b/src/errorout.adb index 39d4af782..3c3a1947f 100644 --- a/src/errorout.adb +++ b/src/errorout.adb @@ -140,6 +140,11 @@ package body Errorout is return (Kind => Earg_Int32, Val_Int32 => V); end "+"; + function "+" (V : Int64) return Earg_Type is + begin + return (Kind => Earg_Int64, Val_Int64 => V); + end "+"; + function "+" (V : String8_Len_Type) return Earg_Type is begin return (Kind => Earg_String8, Val_Str8 => V); @@ -226,6 +231,18 @@ package body Errorout is Report_Handler.Message (S (F .. S'Last)); end Output_Int32; + procedure Output_Int64 (V : Int64) + is + S : constant String := Int64'Image (V); + F : Positive; + begin + F := 1; + if S (F) = ' ' then + F := 2; + end if; + Report_Handler.Message (S (F .. S'Last)); + end Output_Int64; + procedure Output_String8 (Str : String8_Len_Type) is begin Report_Handler.Message (""""); @@ -365,6 +382,12 @@ package body Errorout is else raise Internal_Error; end if; + when Earg_Int64 => + if Format = 'v' then + Output_Int64 (Arg.Val_Int64); + else + raise Internal_Error; + end if; when Earg_Lang_Kind => if Lang_Handlers (Arg.Kind) = null then raise Internal_Error; diff --git a/src/errorout.ads b/src/errorout.ads index 53c926491..d49ff5b5a 100644 --- a/src/errorout.ads +++ b/src/errorout.ads @@ -204,6 +204,7 @@ package Errorout is function "+" (V : String8_Len_Type) return Earg_Type; function "+" (V : Uns32) return Earg_Type; function "+" (V : Int32) return Earg_Type; + function "+" (V : Int64) return Earg_Type; -- Convert location. function "+" (L : Location_Type) return Source_Coord_Type; @@ -273,7 +274,7 @@ package Errorout is type Earg_Kind is (Earg_None, Earg_Location, Earg_Id, - Earg_Char, Earg_String8, Earg_Uns32, Earg_Int32, + Earg_Char, Earg_String8, Earg_Uns32, Earg_Int32, Earg_Int64, Earg_Vhdl_Node, Earg_Vhdl_Token, Earg_Verilog_Node, Earg_Verilog_Token, Earg_Synth_Instance, Earg_Synth_Net, Earg_Synth_Name); @@ -315,6 +316,8 @@ private Val_Uns32 : Uns32; when Earg_Int32 => Val_Int32 : Int32; + when Earg_Int64 => + Val_Int64 : Int64; when Earg_Lang_Kind => Val_Lang : Uns32; end case; -- cgit v1.2.3