diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-08-02 09:17:08 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-08-02 09:17:08 +0200 |
commit | 3c83e47c98bc9e58ca2c231a5b24c3639018c9cc (patch) | |
tree | f2c0133e26ee413d3c778465c552233905a5db56 /src | |
parent | ee0e651d9b3946910d513e6a670453e25e5f014d (diff) | |
download | ghdl-3c83e47c98bc9e58ca2c231a5b24c3639018c9cc.tar.gz ghdl-3c83e47c98bc9e58ca2c231a5b24c3639018c9cc.tar.bz2 ghdl-3c83e47c98bc9e58ca2c231a5b24c3639018c9cc.zip |
Rewrite most of error and warning messages.
Diffstat (limited to 'src')
-rw-r--r-- | src/ghdldrv/ghdllocal.adb | 6 | ||||
-rw-r--r-- | src/libraries.adb | 29 | ||||
-rw-r--r-- | src/vhdl/configuration.adb | 63 | ||||
-rw-r--r-- | src/vhdl/errorout.adb | 58 | ||||
-rw-r--r-- | src/vhdl/errorout.ads | 34 | ||||
-rw-r--r-- | src/vhdl/evaluation.adb | 6 | ||||
-rw-r--r-- | src/vhdl/ieee-vital_timing.adb | 7 | ||||
-rw-r--r-- | src/vhdl/sem.adb | 18 | ||||
-rw-r--r-- | src/vhdl/sem_decls.adb | 2 | ||||
-rw-r--r-- | src/vhdl/sem_specs.adb | 11 | ||||
-rw-r--r-- | src/vhdl/sem_stmts.adb | 6 | ||||
-rw-r--r-- | src/vhdl/simulate/annotations.adb | 3 | ||||
-rw-r--r-- | src/vhdl/simulate/elaboration.adb | 24 | ||||
-rw-r--r-- | src/vhdl/translate/trans-chap12.adb | 18 | ||||
-rw-r--r-- | src/vhdl/translate/trans_analyzes.adb | 6 | ||||
-rw-r--r-- | src/vhdl/translate/trans_be.adb | 7 | ||||
-rw-r--r-- | src/vhdl/translate/translation.adb | 9 |
17 files changed, 183 insertions, 124 deletions
diff --git a/src/ghdldrv/ghdllocal.adb b/src/ghdldrv/ghdllocal.adb index 906bdc046..ca40d9cce 100644 --- a/src/ghdldrv/ghdllocal.adb +++ b/src/ghdldrv/ghdllocal.adb @@ -60,7 +60,8 @@ package body Ghdllocal is end if; if Flags.Verbose then - Put_Line ("analyze " & Disp_Node (Get_Library_Unit (Unit))); + Report_Msg (Msgid_Note, Semantic, No_Location, + "analyze %n", (1 => +Get_Library_Unit (Unit))); end if; Sem.Semantic (Unit); @@ -87,7 +88,8 @@ package body Ghdllocal is or else ((Main or Flags.List_All) and then Flags.List_Canon) then if Flags.Verbose then - Put_Line ("canonicalize " & Disp_Node (Get_Library_Unit (Unit))); + Report_Msg (Msgid_Note, Semantic, No_Location, + "canonicalize %n", (1 => +Get_Library_Unit (Unit))); end if; Canon.Canonicalize (Unit); diff --git a/src/libraries.adb b/src/libraries.adb index 7a24fe0c8..9e9c5093e 100644 --- a/src/libraries.adb +++ b/src/libraries.adb @@ -53,10 +53,15 @@ package body Libraries is Report_Msg (Msgid_Error, Library, No_Location, Msg); end Error_Lib_Msg; + procedure Error_Lib_Msg (Msg : String; Arg1 : Earg_Type) is + begin + Report_Msg (Msgid_Error, Library, No_Location, Msg, (1 => Arg1)); + end Error_Lib_Msg; + -- Report a warning message. - procedure Warning_Lib_Msg (Msg : String) is + procedure Warning_Lib_Msg (Msg : String; Args : Earg_Arr := No_Eargs) is begin - Report_Msg (Msgid_Warning, Library, No_Location, Msg); + Report_Msg (Msgid_Warning, Library, No_Location, Msg, Args); end Warning_Lib_Msg; -- Initialize pathes table. @@ -1010,10 +1015,8 @@ package body Libraries is "redefinition of a library unit in " & "same design file:"); Warning_Msg_Sem - (Warnid_Library, +Unit, - Disp_Node (Library_Unit) & " defined at " - & Disp_Location (Library_Unit) & " is now " - & Disp_Node (New_Library_Unit)); + (Warnid_Library, +Unit, "%n defined at %l is now %n", + (+Library_Unit, +Library_Unit, +New_Library_Unit)); end if; else -- Free the stub. @@ -1030,15 +1033,12 @@ package body Libraries is then Warning_Lib_Msg ("changing definition of a library unit:"); - Warning_Lib_Msg (Disp_Node (Library_Unit) & " is now " - & Disp_Node (New_Library_Unit)); + Warning_Lib_Msg + ("%n is now %n", (+Library_Unit, +New_Library_Unit)); end if; Warning_Lib_Msg - ("library unit '" - & Iirs_Utils.Image_Identifier (Library_Unit) - & "' was also defined in file '" - & Image (Get_Design_File_Filename (Design_File)) - & '''); + ("library unit %i was also defined in file %i", + (+Library_Unit, +Get_Design_File_Filename (Design_File))); end if; end if; exit; @@ -1541,8 +1541,7 @@ package body Libraries is (Get_Design_File_Directory (Design_File), Get_Design_File_Filename (Design_File)); if Fe = No_Source_File_Entry then - Error_Lib_Msg - ("cannot load " & Disp_Node (Get_Library_Unit (Design_Unit))); + Error_Lib_Msg ("cannot load %n", +Get_Library_Unit (Design_Unit)); raise Compilation_Error; end if; Set_File (Fe); diff --git a/src/vhdl/configuration.adb b/src/vhdl/configuration.adb index 5e9bafc99..c4cddca72 100644 --- a/src/vhdl/configuration.adb +++ b/src/vhdl/configuration.adb @@ -67,11 +67,11 @@ package body Configuration is -- May be enabled to debug dependency construction. if False then if From = Null_Iir then - Report_Msg (Msgid_Note, Elaboration, Get_Location (Unit), - Disp_Node (Unit) & " added"); + Report_Msg (Msgid_Note, Elaboration, +Unit, + "%n added", (1 => +Unit)); else - Report_Msg (Msgid_Note, Elaboration, Get_Location (From), - Disp_Node (Unit) & " added by " & Disp_Node (From)); + Report_Msg (Msgid_Note, Elaboration, +From, + "%n added by %n", (+Unit, +From)); end if; end if; @@ -198,10 +198,9 @@ package body Configuration is -- LIB_UNIT requires a body. if Bod = Null_Iir then Error_Msg_Elab - (Lib_Unit, "body of " & Disp_Node (Lib_Unit) - & " was never analyzed"); + (Lib_Unit, "body of %n was never analyzed", +Lib_Unit); elsif Get_Date (Bod) < Get_Date (Unit) then - Error_Msg_Elab (Disp_Node (Bod) & " is outdated"); + Error_Msg_Elab (Bod, "%n is outdated", +Bod); Bod := Null_Iir; end if; end if; @@ -307,9 +306,8 @@ package body Configuration is Id := Get_Identifier (Arch); Arch := Load_Secondary_Unit (Entity, Id, Aspect); if Arch = Null_Iir then - Error_Msg_Elab - ("cannot find architecture " & Name_Table.Image (Id) - & " of " & Disp_Node (Entity_Lib)); + Error_Msg_Elab ("cannot find architecture %i of %n", + (+Id, +Entity_Lib)); return; else Set_Architecture (Aspect, Get_Library_Unit (Arch)); @@ -322,8 +320,8 @@ package body Configuration is else Arch := Get_Latest_Architecture (Entity_Lib); if Arch = Null_Iir then - Error_Msg_Elab (Aspect, "no architecture in library for " - & Disp_Node (Entity_Lib)); + Error_Msg_Elab (Aspect, "no architecture in library for %n", + +Entity_Lib); return; end if; Arch := Get_Design_Unit (Arch); @@ -372,8 +370,7 @@ package body Configuration is -- its declaration includes a default expression. if Get_Default_Value (Port) = Null_Iir then if Loc /= Null_Iir then - Error_Msg_Elab - (Loc, "IN " & Disp_Node (Port) & " must be connected"); + Error_Msg_Elab (Loc, "IN %n must be connected", +Port); end if; return True; end if; @@ -390,8 +387,8 @@ package body Configuration is /= Fully_Constrained) then if Loc /= Null_Iir then - Error_Msg_Elab (Loc, "unconstrained " & Disp_Node (Port) - & " must be connected"); + Error_Msg_Elab + (Loc, "unconstrained %n must be connected", +Port); end if; return True; end if; @@ -430,12 +427,11 @@ package body Configuration is and then not Get_Artificial_Flag (Assoc) then Warning_Msg_Elab - (Warnid_Binding, Assoc, - Disp_Node (Formal) & " of " & Disp_Node (Get_Parent (Formal)) - & " is not bound", Cont => True); + (Warnid_Binding, Assoc, "%n of %n is not bound", + (+Formal, +Get_Parent (Formal)), Cont => True); Warning_Msg_Elab (Warnid_Binding, Current_Configuration, - "(in " & Disp_Node (Current_Configuration) & ")"); + "(in %n)", +Current_Configuration); end if; end if; Assoc := Get_Chain (Assoc); @@ -525,10 +521,10 @@ package body Configuration is Inst := Get_First_Element (Get_Instantiation_List (Conf)); Warning_Msg_Elab (Warnid_Binding, Conf, - Disp_Node (Inst) & " is not bound", Cont => True); + "%n is not bound", +Inst, Cont => True); Warning_Msg_Elab (Warnid_Binding, Current_Configuration, - "(in " & Disp_Node (Current_Configuration) & ")"); + "(in %n)", +Current_Configuration); end if; return; end if; @@ -596,10 +592,8 @@ package body Configuration is if Secondary_Id /= Null_Identifier then Unit := Find_Secondary_Unit (Unit, Secondary_Id); if Unit = Null_Iir then - Error_Msg_Elab - ("cannot find architecture " - & Name_Table.Image (Secondary_Id) - & " of " & Disp_Node (Lib_Unit)); + Error_Msg_Elab ("cannot find architecture %i of %n", + (+Secondary_Id, +Lib_Unit)); return Null_Iir; end if; else @@ -609,9 +603,8 @@ package body Configuration is Arch_Unit := Get_Latest_Architecture (Lib_Unit); if Arch_Unit = Null_Iir then Error_Msg_Elab - (Disp_Node (Lib_Unit) - & " has no architecture in library " - & Name_Table.Image (Get_Identifier (Work_Library))); + ("%n has no architecture in library %i", + (+Lib_Unit, +Work_Library)); return Null_Iir; end if; Unit := Get_Design_Unit (Arch_Unit); @@ -703,14 +696,13 @@ package body Configuration is end case; end Allow_Generic_Override; - procedure Error (Msg : String; Loc : Iir) is + procedure Error (Loc : Iir; Msg : String; Arg1 : Earg_Type) is begin if not Has_Error then - Error_Msg_Elab - (Disp_Node (Entity) & " cannot be at the top of a design"); + Error_Msg_Elab ("%n cannot be at the top of a design", +Entity); Has_Error := True; end if; - Error_Msg_Elab (Loc, Msg); + Error_Msg_Elab (Loc, Msg, Arg1); end Error; El : Iir; @@ -720,7 +712,7 @@ package body Configuration is while El /= Null_Iir loop if Get_Default_Value (El) = Null_Iir then if not Allow_Generic_Override (El) then - Error ("(" & Disp_Node (El) & " has no default value)", El); + Error (El, "(%n has no default value)", +El); end if; end if; El := Get_Chain (El); @@ -732,8 +724,7 @@ package body Configuration is if not Is_Fully_Constrained_Type (Get_Type (El)) and then Get_Default_Value (El) = Null_Iir then - Error ("(" & Disp_Node (El) - & " is unconstrained and has no default value)", El); + Error (El, "(%n is unconstrained and has no default value)", +El); end if; El := Get_Chain (El); end loop; diff --git a/src/vhdl/errorout.adb b/src/vhdl/errorout.adb index 6c08e7328..3e490517f 100644 --- a/src/vhdl/errorout.adb +++ b/src/vhdl/errorout.adb @@ -454,19 +454,43 @@ package body Errorout is raise Option_Error; end Error_Msg_Option; - procedure Warning_Msg_Sem - (Id : Msgid_Warnings; Loc : Location_Type; Msg: String) is + procedure Warning_Msg_Sem (Id : Msgid_Warnings; + Loc : Location_Type; + Msg: String; + Args : Earg_Arr := No_Eargs; + Cont : Boolean := False) is begin if Flags.Flag_Only_Elab_Warnings then return; end if; - Report_Msg (Id, Semantic, Loc, Msg); + Report_Msg (Id, Semantic, Loc, Msg, Args, Cont); end Warning_Msg_Sem; - procedure Warning_Msg_Elab - (Id : Msgid_Warnings; Loc : Iir; Msg: String; Cont : Boolean := False) is + procedure Warning_Msg_Sem (Id : Msgid_Warnings; + Loc : Location_Type; + Msg: String; + Arg1 : Earg_Type; + Cont : Boolean := False) is begin - Report_Msg (Id, Elaboration, Get_Location_Safe (Loc), Msg, Cont => Cont); + Warning_Msg_Sem (Id, Loc, Msg, Earg_Arr'(1 => Arg1), Cont); + end Warning_Msg_Sem; + + procedure Warning_Msg_Elab (Id : Msgid_Warnings; + Loc : Iir; + Msg: String; + Arg1 : Earg_Type; + Cont : Boolean := False) is + begin + Report_Msg (Id, Elaboration, +Loc, Msg, Earg_Arr'(1 => Arg1), Cont); + end Warning_Msg_Elab; + + procedure Warning_Msg_Elab (Id : Msgid_Warnings; + Loc : Iir; + Msg: String; + Args : Earg_Arr := No_Eargs; + Cont : Boolean := False) is + begin + Report_Msg (Id, Elaboration, +Loc, Msg, Args, Cont); end Warning_Msg_Elab; -- Disp a message during scan. @@ -570,14 +594,28 @@ package body Errorout is end Error_Msg_Sem_Relaxed; -- Disp a message during elaboration. - procedure Error_Msg_Elab (Msg: String) is + procedure Error_Msg_Elab + (Msg: String; Args : Earg_Arr := No_Eargs) is + begin + Report_Msg (Msgid_Error, Elaboration, No_Location, Msg, Args); + end Error_Msg_Elab; + + procedure Error_Msg_Elab + (Msg: String; Arg1 : Earg_Type) is + begin + Error_Msg_Elab (Msg, Earg_Arr'(1 => Arg1)); + end Error_Msg_Elab; + + procedure Error_Msg_Elab + (Loc: Iir; Msg: String; Args : Earg_Arr := No_Eargs) is begin - Report_Msg (Msgid_Error, Elaboration, No_Location, Msg); + Report_Msg (Msgid_Error, Elaboration, +Loc, Msg, Args); end Error_Msg_Elab; - procedure Error_Msg_Elab (Loc : Iir; Msg: String) is + procedure Error_Msg_Elab + (Loc: Iir; Msg: String; Arg1 : Earg_Type) is begin - Report_Msg (Msgid_Error, Elaboration, Get_Location_Safe (Loc), Msg); + Error_Msg_Elab (Loc, Msg, Earg_Arr'(1 => Arg1)); end Error_Msg_Elab; -- Disp a bug message. diff --git a/src/vhdl/errorout.ads b/src/vhdl/errorout.ads index e1beb156b..bdc67226a 100644 --- a/src/vhdl/errorout.ads +++ b/src/vhdl/errorout.ads @@ -179,8 +179,16 @@ package Errorout is procedure Error_Msg_Parse (Loc : Location_Type; Msg: String); -- Disp a message during semantic analysis. - procedure Warning_Msg_Sem - (Id : Msgid_Warnings; Loc : Location_Type; Msg: String); + procedure Warning_Msg_Sem (Id : Msgid_Warnings; + Loc : Location_Type; + Msg: String; + Args : Earg_Arr := No_Eargs; + Cont : Boolean := False); + procedure Warning_Msg_Sem (Id : Msgid_Warnings; + Loc : Location_Type; + Msg: String; + Arg1 : Earg_Type; + Cont : Boolean := False); procedure Error_Msg_Sem (Loc: Location_Type; Msg: String; @@ -196,12 +204,26 @@ package Errorout is Args : Earg_Arr := No_Eargs); -- Disp a message during elaboration (or configuration). - procedure Error_Msg_Elab (Msg: String); - procedure Error_Msg_Elab (Loc: Iir; Msg: String); + procedure Error_Msg_Elab + (Msg: String; Args : Earg_Arr := No_Eargs); + procedure Error_Msg_Elab + (Msg: String; Arg1 : Earg_Type); + procedure Error_Msg_Elab + (Loc: Iir; Msg: String; Args : Earg_Arr := No_Eargs); + procedure Error_Msg_Elab + (Loc: Iir; Msg: String; Arg1 : Earg_Type); -- Disp a warning durig elaboration (or configuration). - procedure Warning_Msg_Elab - (Id : Msgid_Warnings; Loc : Iir; Msg: String; Cont : Boolean := False); + procedure Warning_Msg_Elab (Id : Msgid_Warnings; + Loc : Iir; + Msg: String; + Arg1 : Earg_Type; + Cont : Boolean := False); + procedure Warning_Msg_Elab (Id : Msgid_Warnings; + Loc : Iir; + Msg: String; + Args : Earg_Arr := No_Eargs; + Cont : Boolean := False); -- Disp a bug message. procedure Error_Internal (Expr: Iir; Msg: String := ""); diff --git a/src/vhdl/evaluation.adb b/src/vhdl/evaluation.adb index 3b89eb14f..1713e4af5 100644 --- a/src/vhdl/evaluation.adb +++ b/src/vhdl/evaluation.adb @@ -1649,9 +1649,9 @@ package body Evaluation is if Res /= Null_Iir then return Build_Constant (Res, Expr); else - Warning_Msg_Sem (Warnid_Runtime_Error, +Expr, - "value """ & Value & """ not in enumeration " - & Disp_Node (Enum)); + Warning_Msg_Sem + (Warnid_Runtime_Error, +Expr, + "value """ & Value & """ not in enumeration %n", +Enum); return Build_Overflow (Expr); end if; end Build_Enumeration_Value; diff --git a/src/vhdl/ieee-vital_timing.adb b/src/vhdl/ieee-vital_timing.adb index 12811be38..0b176cdba 100644 --- a/src/vhdl/ieee-vital_timing.adb +++ b/src/vhdl/ieee-vital_timing.adb @@ -190,9 +190,10 @@ package body Ieee.Vital_Timing is Error_Msg_Sem (Loc, Msg); end Error_Vital; - procedure Warning_Vital (Loc : Iir; Msg : String) is + procedure Warning_Vital + (Loc : Iir; Msg : String; Args : Earg_Arr := No_Eargs) is begin - Warning_Msg_Sem (Warnid_Vital_Generic, +Loc, Msg); + Warning_Msg_Sem (Warnid_Vital_Generic, +Loc, Msg, Args); end Warning_Vital; -- Check DECL is the VITAL level 0 attribute specification. @@ -1260,7 +1261,7 @@ package body Ieee.Vital_Timing is end if; if Is_Warning_Enabled (Warnid_Vital_Generic) then - Warning_Vital (Decl, Disp_Node (Decl) & " is not a VITAL generic"); + Warning_Vital (Decl, "%n is not a VITAL generic", (1 => +Decl)); end if; end Check_Entity_Generic_Declaration; diff --git a/src/vhdl/sem.adb b/src/vhdl/sem.adb index 9e4540308..dab4d9f83 100644 --- a/src/vhdl/sem.adb +++ b/src/vhdl/sem.adb @@ -2460,16 +2460,17 @@ package body Sem is pragma Assert (Callees /= Null_Iir_List); Warning_Msg_Sem (Warnid_Delayed_Checks, +El, - "can't assert that all calls in " & Disp_Node (El) - & " are pure or have not wait; " - & "will be checked at elaboration"); + "can't assert that all calls in %n" + & " are pure or have not wait;" + & " will be checked at elaboration", + +El, Cont => True); Callee := Get_Nth_Element (Callees, 0); -- FIXME: could improve this message by displaying the -- chain of calls until the first subprograms in -- unknown state. Warning_Msg_Sem (Warnid_Delayed_Checks, +Callee, - "(first such call is to " & Disp_Node (Callee) & ")"); + "(first such call is to %n)", +Callee); end if; end if; when Iir_Kind_Sensitized_Process_Statement => @@ -2478,8 +2479,8 @@ package body Sem is if Emit_Warnings then Warning_Msg_Sem (Warnid_Delayed_Checks, +El, - "can't assert that " & Disp_Node (El) - & " has not wait; will be checked at elaboration"); + "can't assert that %n has not wait; " + & "will be checked at elaboration", +El); end if; end if; when others => @@ -2629,9 +2630,8 @@ package body Sem is -- Emit a warning is a body is not necessary. if not Get_Need_Body (Package_Decl) then - Warning_Msg_Sem - (Warnid_Body, +Decl, - Disp_Node (Package_Decl) & " does not require a body"); + Warning_Msg_Sem (Warnid_Body, +Decl, + "%n does not require a body", +Package_Decl); end if; Set_Package (Decl, Package_Decl); diff --git a/src/vhdl/sem_decls.adb b/src/vhdl/sem_decls.adb index a2b7101e9..37c35afc2 100644 --- a/src/vhdl/sem_decls.adb +++ b/src/vhdl/sem_decls.adb @@ -3076,7 +3076,7 @@ package body Sem_Decls is and then not Is_Second_Subprogram_Specification (El) then Warning_Msg_Sem (Warnid_Unused, +El, - Disp_Node (El) & " is never referenced"); + "%n is never referenced", +El); end if; when others => null; diff --git a/src/vhdl/sem_specs.adb b/src/vhdl/sem_specs.adb index 7eaa78c34..3cc08d03c 100644 --- a/src/vhdl/sem_specs.adb +++ b/src/vhdl/sem_specs.adb @@ -27,7 +27,6 @@ with Sem_Assocs; use Sem_Assocs; with Libraries; with Iir_Chains; use Iir_Chains; with Flags; use Flags; -with Name_Table; with Std_Names; with Sem_Decls; with Xrefs; use Xrefs; @@ -1779,8 +1778,7 @@ package body Sem_Specs is -- (see 10.3), Decl := Get_Declaration (Inter); Warning_Msg_Elab - (Warnid_Default_Binding, Decl, - "visible declaration for " & Name_Table.Image (Name)); + (Warnid_Default_Binding, Decl, "visible declaration for %i", +Name); -- b) An entity declaration that has the same simple name that of -- the instantiated component and that would be directly @@ -1792,8 +1790,8 @@ package body Sem_Specs is if Valid_Interpretation (Inter) then Decl := Get_Declaration (Inter); Warning_Msg_Elab (Warnid_Default_Binding, Comp, - "interpretation behind the component is " - & Disp_Node (Decl)); + "interpretation behind the component is %n", + +Decl); end if; end if; end if; @@ -1813,8 +1811,7 @@ package body Sem_Specs is end loop; Warning_Msg_Elab (Warnid_Default_Binding, Comp, - "no entity """ & Name_Table.Image (Name) & """ in " - & Disp_Node (Decl)); + "no entity %i in %n", (+Name, +Decl)); end if; end Explain_No_Visible_Entity; diff --git a/src/vhdl/sem_stmts.adb b/src/vhdl/sem_stmts.adb index 07d1e7f30..bc5ec9573 100644 --- a/src/vhdl/sem_stmts.adb +++ b/src/vhdl/sem_stmts.adb @@ -1506,9 +1506,9 @@ package body Sem_Stmts is if Is_Warning_Enabled (Warnid_Default_Binding) and then not Flags.Flag_Elaborate then - Warning_Msg_Sem (Warnid_Default_Binding, +Stmt, - "no default binding for instantiation of " - & Disp_Node (Decl)); + Warning_Msg_Sem + (Warnid_Default_Binding, +Stmt, + "no default binding for instantiation of %n", +Decl); Explain_No_Visible_Entity (Decl); end if; elsif Flags.Flag_Elaborate diff --git a/src/vhdl/simulate/annotations.adb b/src/vhdl/simulate/annotations.adb index a7c2869a5..4b6270afd 100644 --- a/src/vhdl/simulate/annotations.adb +++ b/src/vhdl/simulate/annotations.adb @@ -1193,7 +1193,8 @@ package body Annotations is El := Get_Library_Unit (Tree); if Trace_Annotation then - Ada.Text_IO.Put_Line ("annotating " & Disp_Node (El)); + Report_Msg (Msgid_Note, Semantic, No_Location, + "annotating %n", (1 => +El)); end if; case Get_Kind (El) is when Iir_Kind_Entity_Declaration => diff --git a/src/vhdl/simulate/elaboration.adb b/src/vhdl/simulate/elaboration.adb index f205ea1e4..7ca7063cf 100644 --- a/src/vhdl/simulate/elaboration.adb +++ b/src/vhdl/simulate/elaboration.adb @@ -374,7 +374,8 @@ package body Elaboration is Package_Instances (Package_Info.Frame_Scope.Pkg_Index) := Instance; if Trace_Elaboration then - Ada.Text_IO.Put_Line ("elaborating " & Disp_Node (Decl)); + Report_Msg (Msgid_Note, Errorout.Elaboration, No_Location, + "elaborating %n", (1 => +Decl)); end if; if Get_Kind (Decl) = Iir_Kind_Package_Instantiation_Declaration then @@ -406,7 +407,8 @@ package body Elaboration is Instance := Package_Instances (Package_Info.Frame_Scope.Pkg_Index); if Trace_Elaboration then - Ada.Text_IO.Put_Line ("elaborating " & Disp_Node (Decl)); + Report_Msg (Msgid_Note, Errorout.Elaboration, No_Location, + "elaborating %n", (1 => +Decl)); end if; -- Elaborate objects declarations. @@ -1891,7 +1893,7 @@ package body Elaboration is -- such a design entity. if not Is_Fully_Bound (Conf) then Warning_Msg_Elab - (Warnid_Binding, Stmt, Disp_Node (Stmt) & " not bound"); + (Warnid_Binding, Stmt, "%n not bound", +Stmt); return; end if; @@ -1949,17 +1951,16 @@ package body Elaboration is if Arch_Name = Null_Identifier then Arch := Libraries.Get_Latest_Architecture (Entity); if Arch = Null_Iir then - Error_Msg_Elab (Stmt, "no architecture analysed for " - & Disp_Node (Entity)); + Error_Msg_Elab + (Stmt, "no architecture analysed for %n", +Entity); end if; Arch_Name := Get_Identifier (Arch); end if; Arch_Design := Libraries.Load_Secondary_Unit (Get_Design_Unit (Entity), Arch_Name, Stmt); if Arch_Design = Null_Iir then - Error_Msg_Elab (Stmt, - "no architecture `" & Name_Table.Image (Arch_Name) - & "' for " & Disp_Node (Entity)); + Error_Msg_Elab + (Stmt, "no architecture %i for %n", (+Arch_Name, +Entity)); end if; Arch := Get_Library_Unit (Arch_Design); end if; @@ -2720,7 +2721,7 @@ package body Elaboration is Res := Eval_Value_Attribute (Str, Formal_Type, Formal); if not Eval_Is_In_Bound (Res, Formal_Type) then Error_Msg_Elab - ("override for " & Disp_Node (Formal) & " is out of bounds"); + ("override for %n is out of bounds", +Formal); return Null_Iir; end if; return Res; @@ -2748,7 +2749,7 @@ package body Elaboration is when others => null; end case; - Error_Msg_Elab ("unhandled override for " & Disp_Node (Formal)); + Error_Msg_Elab ("unhandled override for %n", +Formal); return Null_Iir; end Override_Generic; @@ -2815,8 +2816,7 @@ package body Elaboration is and then not Is_Fully_Constrained_Type (Get_Type (Formal)) then Error_Msg_Elab - (Formal, - "top-level " & Disp_Node (Formal) & " must have a value"); + (Formal, "top-level %n must have a value", +Formal); end if; end if; Assoc := Get_Chain (Assoc); diff --git a/src/vhdl/translate/trans-chap12.adb b/src/vhdl/translate/trans-chap12.adb index 25b73fa71..931a34990 100644 --- a/src/vhdl/translate/trans-chap12.adb +++ b/src/vhdl/translate/trans-chap12.adb @@ -19,7 +19,6 @@ with System; with Configuration; with Interfaces.C_Streams; -with Ada.Text_IO; with Errorout; use Errorout; with Std_Package; use Std_Package; with Iirs_Utils; use Iirs_Utils; @@ -203,7 +202,7 @@ package body Trans.Chap12 is begin Arch := Libraries.Get_Latest_Architecture (Entity); if Arch = Null_Iir then - Error_Msg_Elab ("no architecture for " & Disp_Node (Entity)); + Error_Msg_Elab ("no architecture for %n", +Entity); end if; Arch_Info := Get_Info (Arch); if Arch_Info = null then @@ -480,8 +479,7 @@ package body Trans.Chap12 is exit when Dep = Null_Iir; Dep_Unit := Libraries.Find_Design_Unit (Dep); if Dep_Unit = Null_Iir then - Error_Msg_Elab - ("could not find design unit " & Disp_Node (Dep)); + Error_Msg_Elab ("could not find design unit %n", +Dep); elsif not Get_Elab_Flag (Dep_Unit) then Add_Unit_Dependences (Dep_Unit); end if; @@ -636,11 +634,13 @@ package body Trans.Chap12 is end if; if Flags.Verbose then - Ada.Text_IO.Put_Line ("List of units in the hierarchy design:"); + Report_Msg (Msgid_Note, Elaboration, No_Location, + "List of units in the hierarchy design:"); for I in Design_Units.First .. Design_Units.Last loop Unit := Design_Units.Table (I); Lib_Unit := Get_Library_Unit (Unit); - Ada.Text_IO.Put_Line (' ' & Disp_Node (Lib_Unit)); + Report_Msg (Msgid_Note, Elaboration, No_Location, + " %n", (1 => +Lib_Unit)); end loop; end if; @@ -750,11 +750,13 @@ package body Trans.Chap12 is -- Disp list of files needed. if Flags.Verbose then - Ada.Text_IO.Put_Line ("List of units not used:"); + Report_Msg (Msgid_Note, Elaboration, No_Location, + "List of units not used:"); for I in Last_Design_Unit + 1 .. Design_Units.Last loop Unit := Design_Units.Table (I); Lib_Unit := Get_Library_Unit (Unit); - Ada.Text_IO.Put_Line (' ' & Disp_Node (Lib_Unit)); + Report_Msg (Msgid_Note, Elaboration, No_Location, + " %n", (1 => +Lib_Unit)); end loop; end if; end Elaborate; diff --git a/src/vhdl/translate/trans_analyzes.adb b/src/vhdl/translate/trans_analyzes.adb index 799930a80..8fce7c2bc 100644 --- a/src/vhdl/translate/trans_analyzes.adb +++ b/src/vhdl/translate/trans_analyzes.adb @@ -179,8 +179,10 @@ package body Trans_Analyzes is use Errorout; El : Iir; begin - Put_Line ("List of drivers for " & Disp_Node (Proc) & ":"); - Put_Line (" (declared at " & Disp_Location (Proc) & ")"); + Report_Msg (Msgid_Note, Semantic, +Proc, + "List of drivers for %n:", (1 => +Proc)); + Report_Msg (Msgid_Note, Semantic, +Proc, + " (declared at %l)", (1 => +Proc)); for I in Natural loop El := Get_Nth_Element (List, I); exit when El = Null_Iir; diff --git a/src/vhdl/translate/trans_be.adb b/src/vhdl/translate/trans_be.adb index 998271ef6..64906f85c 100644 --- a/src/vhdl/translate/trans_be.adb +++ b/src/vhdl/translate/trans_be.adb @@ -15,6 +15,7 @@ -- along with GCC; see the file COPYING. If not, write to the Free -- Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- 02111-1307, USA. +with Types; use Types; with Iirs; use Iirs; with Disp_Tree; with Disp_Vhdl; @@ -40,7 +41,8 @@ package body Trans_Be is -- Semantic analysis. if Flags.Verbose then - Put_Line ("analyze " & Disp_Node (Lib)); + Report_Msg (Msgid_Note, Semantic, No_Location, + "analyse %n", (1 => +Lib)); end if; Sem.Semantic (Unit); @@ -68,7 +70,8 @@ package body Trans_Be is -- Canonalisation. ------------------ if Flags.Verbose then - Put_Line ("canonicalize " & Disp_Node (Lib)); + Report_Msg (Msgid_Note, Semantic, No_Location, + "canonicalize %n", (1 => +Lib)); end if; Canon.Canonicalize (Unit); diff --git a/src/vhdl/translate/translation.adb b/src/vhdl/translate/translation.adb index 27da99f97..741a20503 100644 --- a/src/vhdl/translate/translation.adb +++ b/src/vhdl/translate/translation.adb @@ -18,7 +18,6 @@ with Ortho_Nodes; use Ortho_Nodes; with Ortho_Ident; use Ortho_Ident; with Flags; use Flags; -with Ada.Text_IO; with Types; use Types; with Errorout; use Errorout; with Name_Table; -- use Name_Table; @@ -229,11 +228,13 @@ package body Translation is El := Get_Library_Unit (Unit); if Flags.Verbose then - Ada.Text_IO.Put ("translating "); if Main then - Ada.Text_IO.Put ("(with code generation) "); + Report_Msg (Msgid_Note, Semantic, No_Location, + "translating (with code generation) %n", (1 => +El)); + else + Report_Msg (Msgid_Note, Semantic, No_Location, + "translating %n", (1 => +El)); end if; - Ada.Text_IO.Put_Line (Disp_Node (El)); end if; -- Create the prefix for identifiers. |