@@ -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,14 @@ 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+
39+ procedure Write
40+ (CSS : in out Checkpoint_Save_State; Value : ALI_Annotation);
41+ -- Write a ALI_Annotation to CSS
42+
3443 -- ---------------------------------------------
3544 -- Regular expressions for ALI files parsing --
3645 -- ---------------------------------------------
@@ -627,37 +636,69 @@ package body ALI_Files is
627636 -- --------
628637
629638 procedure Read
630- (S : access Root_Stream_Type'Class;
631- V : out ALI_Annotation)
632- is
639+ (CLS : in out Checkpoint_Load_State; Value : out ALI_Annotation) is
633640 begin
634- CU_Id'Read (S, V.CU) ;
635- ALI_Annotation_Kind'Read (S, V.Kind );
641+ Value.CU := CLS.Read_CU ;
642+ Value.Kind := ALI_Annotation_Kind'Val (CLS.Read_U8 );
636643
637644 declare
638- Msg : constant String := String'Input (S) ;
645+ Msg : constant String := CLS.Read_String ;
639646 begin
640647 if Msg'Length > 0 then
641- V .Message := new String'(Msg);
648+ Value .Message := new String'(Msg);
642649 end if ;
643650 end ;
644- V.Violation_Count := 0 ;
645- V.Undetermined_Cov_Count := 0 ;
651+
652+ Value.Violation_Count := 0 ;
653+ Value.Undetermined_Cov_Count := 0 ;
654+ end Read ;
655+
656+ procedure Read
657+ (CLS : in out Checkpoints.Checkpoint_Load_State;
658+ Value : out ALI_Annotation_Maps.Map)
659+ is
660+ procedure Read_Map is new Checkpoints.Read_Map
661+ (Key_Type => Source_Location,
662+ Element_Type => ALI_Annotation,
663+ Map_Type => ALI_Annotation_Maps.Map,
664+ Clear => ALI_Annotation_Maps.Clear,
665+ Insert => ALI_Annotation_Maps.Insert,
666+ Read_Key => Read,
667+ Read_Element => Read);
668+ begin
669+ Read_Map (CLS, Value);
646670 end Read ;
647671
648672 -- ---------
649673 -- Write --
650674 -- ---------
651675
652- procedure Write (S : access Root_Stream_Type'Class; V : ALI_Annotation) is
676+ procedure Write (CSS : in out Checkpoint_Save_State; Value : ALI_Annotation)
677+ is
653678 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 ;
679+ CSS.Write_CU (Value.CU);
680+ CSS.Write_U8 (ALI_Annotation_Kind'Pos (Value.Kind));
681+ CSS.Write_Unbounded (if Value.Message = null
682+ then " "
683+ else Value.Message.all );
684+ end Write ;
685+
686+ procedure Write
687+ (CSS : in out Checkpoints.Checkpoint_Save_State;
688+ Value : ALI_Annotation_Maps.Map)
689+ is
690+ procedure Write_Map is new Checkpoints.Write_Map
691+ (Key_Type => Source_Location,
692+ Element_Type => ALI_Annotation,
693+ Map_Type => ALI_Annotation_Maps.Map,
694+ Cursor_Type => ALI_Annotation_Maps.Cursor,
695+ Length => ALI_Annotation_Maps.Length,
696+ Iterate => ALI_Annotation_Maps.Iterate,
697+ Query_Element => ALI_Annotation_Maps.Query_Element,
698+ Write_Key => Write,
699+ Write_Element => Write);
700+ begin
701+ Write_Map (CSS, Value);
661702 end Write ;
662703
663704end ALI_Files ;
0 commit comments