@@ -23,6 +23,7 @@ with Ada.Text_IO; use Ada.Text_IO;
2323with GNAT.Regpat ; use GNAT.Regpat;
2424with SCOs ;
2525
26+ with Checkpoints ; use Checkpoints;
2627with Diagnostics ; use Diagnostics;
2728with Files_Table ; use Files_Table;
2829with Get_SCOs ;
@@ -31,6 +32,10 @@ with Outputs; use Outputs;
3132
3233package body ALI_Files is
3334
35+ procedure Read
36+ (CLS : in out Checkpoint_Load_State; Value : out ALI_Annotation);
37+ -- Read a ALI_Annotation from CLS
38+
3439 -- ---------------------------------------------
3540 -- Regular expressions for ALI files parsing --
3641 -- ---------------------------------------------
@@ -622,42 +627,57 @@ package body ALI_Files is
622627 return ALI_Index;
623628 end Load_ALI ;
624629
630+ -- ---------
631+ -- Write --
632+ -- ---------
633+
634+ procedure Write (S : access Root_Stream_Type'Class; V : ALI_Annotation) is
635+ begin
636+ CU_Id'Write (S, V.CU);
637+ ALI_Annotation_Kind'Write (S, V.Kind);
638+ if V.Message /= null then
639+ String'Output (S, V.Message.all );
640+ else
641+ String'Output (S, " " );
642+ end if ;
643+ end Write ;
644+
625645 -- --------
626646 -- Read --
627647 -- --------
628648
629649 procedure Read
630- (S : access Root_Stream_Type'Class;
631- V : out ALI_Annotation)
632- is
650+ (CLS : in out Checkpoint_Load_State; Value : out ALI_Annotation) is
633651 begin
634- CU_Id'Read (S, V.CU) ;
635- ALI_Annotation_Kind'Read (S, V.Kind );
652+ Value.CU := CLS.Read_CU ;
653+ Value.Kind := ALI_Annotation_Kind'Val (CLS.Read_U8 );
636654
637655 declare
638- Msg : constant String := String'Input (S) ;
656+ Msg : constant String := CLS.Read_String ;
639657 begin
640658 if Msg'Length > 0 then
641- V .Message := new String'(Msg);
659+ Value .Message := new String'(Msg);
642660 end if ;
643661 end ;
644- V.Violation_Count := 0 ;
645- V.Undetermined_Cov_Count := 0 ;
646- end Read ;
647662
648- -- ---------
649- -- Write --
650- -- ---------
663+ Value.Violation_Count := 0 ;
664+ Value.Undetermined_Cov_Count := 0 ;
665+ end Read ;
651666
652- procedure Write (S : access Root_Stream_Type'Class; V : ALI_Annotation) is
667+ procedure Read
668+ (CLS : access Checkpoints.Checkpoint_Load_State;
669+ Value : out ALI_Annotation_Maps.Map)
670+ is
671+ procedure Read_Map is new Checkpoints.Read_Map
672+ (Key_Type => Source_Location,
673+ Element_Type => ALI_Annotation,
674+ Map_Type => ALI_Annotation_Maps.Map,
675+ Clear => ALI_Annotation_Maps.Clear,
676+ Insert => ALI_Annotation_Maps.Insert,
677+ Read_Key => Read,
678+ Read_Element => Read);
653679 begin
654- CU_Id'Write (S, V.CU);
655- ALI_Annotation_Kind'Write (S, V.Kind);
656- if V.Message /= null then
657- String'Output (S, V.Message.all );
658- else
659- String'Output (S, " " );
660- end if ;
661- end Write ;
680+ Read_Map (CLS.all , Value);
681+ end Read ;
662682
663683end ALI_Files ;
0 commit comments