@@ -23,6 +23,7 @@ with Ada.Text_IO; use Ada.Text_IO;
23
23
with GNAT.Regpat ; use GNAT.Regpat;
24
24
with SCOs ;
25
25
26
+ with Checkpoints ; use Checkpoints;
26
27
with Diagnostics ; use Diagnostics;
27
28
with Files_Table ; use Files_Table;
28
29
with Get_SCOs ;
@@ -31,6 +32,10 @@ with Outputs; use Outputs;
31
32
32
33
package body ALI_Files is
33
34
35
+ procedure Read
36
+ (CLS : in out Checkpoint_Load_State; Value : out ALI_Annotation);
37
+ -- Read a ALI_Annotation from CLS
38
+
34
39
-- ---------------------------------------------
35
40
-- Regular expressions for ALI files parsing --
36
41
-- ---------------------------------------------
@@ -622,42 +627,57 @@ package body ALI_Files is
622
627
return ALI_Index;
623
628
end Load_ALI ;
624
629
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
+
625
645
-- --------
626
646
-- Read --
627
647
-- --------
628
648
629
649
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
633
651
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 );
636
654
637
655
declare
638
- Msg : constant String := String'Input (S) ;
656
+ Msg : constant String := CLS.Read_String ;
639
657
begin
640
658
if Msg'Length > 0 then
641
- V .Message := new String'(Msg);
659
+ Value .Message := new String'(Msg);
642
660
end if ;
643
661
end ;
644
- V.Violation_Count := 0 ;
645
- V.Undetermined_Cov_Count := 0 ;
646
- end Read ;
647
662
648
- -- ---------
649
- -- Write --
650
- -- ---------
663
+ Value.Violation_Count := 0 ;
664
+ Value.Undetermined_Cov_Count := 0 ;
665
+ end Read ;
651
666
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);
653
679
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 ;
662
682
663
683
end ALI_Files ;
0 commit comments