Skip to content

Commit c1972f9

Browse files
committed
Checkpoint_Load: replace access argument types with IN OUT modes
Now that we do not use streaming attributes anymore, it makes more sense to use IN OUT modes for the Checkpoint_Load_State argument rather than access types: no need to take 'Access or dereference once in a while.
1 parent 2458823 commit c1972f9

18 files changed

+48
-48
lines changed

tools/gnatcov/ali_files.adb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ package body ALI_Files is
665665
end Read;
666666

667667
procedure Read
668-
(CLS : access Checkpoints.Checkpoint_Load_State;
668+
(CLS : in out Checkpoints.Checkpoint_Load_State;
669669
Value : out ALI_Annotation_Maps.Map)
670670
is
671671
procedure Read_Map is new Checkpoints.Read_Map
@@ -677,7 +677,7 @@ package body ALI_Files is
677677
Read_Key => Read,
678678
Read_Element => Read);
679679
begin
680-
Read_Map (CLS.all, Value);
680+
Read_Map (CLS, Value);
681681
end Read;
682682

683683
end ALI_Files;

tools/gnatcov/ali_files.ads

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ package ALI_Files is
7777
Element_Type => ALI_Annotation);
7878

7979
procedure Read
80-
(CLS : access Checkpoints.Checkpoint_Load_State;
80+
(CLS : in out Checkpoints.Checkpoint_Load_State;
8181
Value : out ALI_Annotation_Maps.Map);
8282
-- Read a ALI_Annotation_Maps.Map from CLS
8383

tools/gnatcov/checkpoints.adb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ package body Checkpoints is
563563
Raise_Stub_Internal_Error_For (Load_Checkpoint);
564564

565565
declare
566-
CLS : aliased Checkpoint_Load_State :=
566+
CLS : Checkpoint_Load_State :=
567567
(Root_Stream_Type with
568568
Stream => Stream (SF),
569569
Filename => To_Unbounded_String (Filename),
@@ -645,11 +645,11 @@ package body Checkpoints is
645645
Update_Current_Trace_Kind
646646
(Any_Accepted_Trace_Kind'Val (CLS.Read_U8));
647647

648-
Files_Table.Checkpoint_Load (CLS'Access, Ignored_Source_Files);
649-
SC_Obligations.Checkpoint_Load (CLS'Access);
650-
Instrument.Checkpoints.Checkpoint_Load (CLS'Access);
651-
Coverage.Source.Checkpoint_Load (CLS'Access);
652-
Traces_Files_Registry.Checkpoint_Load (CLS'Access);
648+
Files_Table.Checkpoint_Load (CLS, Ignored_Source_Files);
649+
SC_Obligations.Checkpoint_Load (CLS);
650+
Instrument.Checkpoints.Checkpoint_Load (CLS);
651+
Coverage.Source.Checkpoint_Load (CLS);
652+
Traces_Files_Registry.Checkpoint_Load (CLS);
653653

654654
Free (CLS.Relocations);
655655
end;

tools/gnatcov/coverage-source.adb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ package body Coverage.Source is
493493
-- Checkpoint_Load --
494494
---------------------
495495

496-
procedure Checkpoint_Load (CLS : access Checkpoint_Load_State) is
496+
procedure Checkpoint_Load (CLS : in out Checkpoint_Load_State) is
497497
use SCI_Vector_Vectors;
498498

499499
CP_Tag_Provider : Unbounded_String;
@@ -524,7 +524,7 @@ package body Coverage.Source is
524524
-- Even if we cannot merge coverage information, we must read it in
525525
-- order to be able to decode the rest of the checkpoint.
526526

527-
Read (CLS.all, CP_SCI_Vector);
527+
Read (CLS, CP_SCI_Vector);
528528

529529
if not Do_Merge then
530530
return;

tools/gnatcov/coverage-source.ads

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ package Coverage.Source is
152152
procedure Checkpoint_Clear;
153153
-- Clear the internal data structures used to create checkpoints
154154

155-
procedure Checkpoint_Load (CLS : access Checkpoint_Load_State);
155+
procedure Checkpoint_Load (CLS : in out Checkpoint_Load_State);
156156
-- Load checkpointed coverage state from S and merge into current state
157157

158158
end Coverage.Source;

tools/gnatcov/files_table.adb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1951,7 +1951,7 @@ package body Files_Table is
19511951
---------------------
19521952

19531953
procedure Checkpoint_Load
1954-
(CLS : access Checkpoint_Load_State;
1954+
(CLS : in out Checkpoint_Load_State;
19551955
Ignored_Source_Files : access GNAT.Regexp.Regexp)
19561956
is
19571957
pragma Assert

tools/gnatcov/files_table.ads

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ package Files_Table is
573573
-- Clear the internal data structures used to create checkpoints
574574

575575
procedure Checkpoint_Load
576-
(CLS : access Checkpoints.Checkpoint_Load_State;
576+
(CLS : in out Checkpoints.Checkpoint_Load_State;
577577
Ignored_Source_Files : access GNAT.Regexp.Regexp);
578578
-- Load checkpointed files table from S and merge in current state.
579579
-- Ignore_Source_Files should be null if the checkpoint purpose is

tools/gnatcov/instrument-checkpoints.adb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ package body Instrument.Checkpoints is
4848
-- Checkpoint_Load --
4949
---------------------
5050

51-
procedure Checkpoint_Load (CLS : access Checkpoint_Load_State) is
51+
procedure Checkpoint_Load (CLS : in out Checkpoint_Load_State) is
5252
Relocs : Checkpoint_Relocations renames CLS.Relocations;
5353
begin
5454
declare
5555
use Instrumented_Unit_To_CU_Maps;
5656
CP_IU_Map : Map;
5757
begin
58-
Read (CLS.all, CP_IU_Map);
58+
Read (CLS, CP_IU_Map);
5959

6060
for Cur in CP_IU_Map.Iterate loop
6161
declare
@@ -99,7 +99,7 @@ package body Instrument.Checkpoints is
9999
CP_PP_Cmds : SFI_To_PP_Cmd_Maps.Map;
100100
CP_SFI : Source_File_Index;
101101
begin
102-
Read (CLS.all, CP_PP_Cmds);
102+
Read (CLS, CP_PP_Cmds);
103103

104104
for CP_Cur in CP_PP_Cmds.Iterate loop
105105

tools/gnatcov/instrument-checkpoints.ads

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ package Instrument.Checkpoints is
2727
procedure Checkpoint_Clear;
2828
-- Clear the internal data structures used to create checkpoints
2929

30-
procedure Checkpoint_Load (CLS : access Checkpoint_Load_State);
30+
procedure Checkpoint_Load (CLS : in out Checkpoint_Load_State);
3131
-- Load instrumentation-specific data from stream and merge them in the
3232
-- current state.
3333

tools/gnatcov/sc_obligations-bdd.adb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ package body SC_Obligations.BDD is
3232
procedure Read (CLS : in out Checkpoint_Load_State; Value : out BDD_Node);
3333
-- Read a BDD_Node from CLS
3434

35-
procedure Read is new Read_Vector
35+
procedure Read_BDD_Vector is new Read_Vector
3636
(Index_Type => Valid_BDD_Node_Id,
3737
Element_Type => BDD_Node,
3838
"=" => "=",
@@ -132,7 +132,7 @@ package body SC_Obligations.BDD is
132132
----------
133133

134134
procedure Read
135-
(CLS : access Checkpoints.Checkpoint_Load_State; Value : out BDD_Type) is
135+
(CLS : in out Checkpoints.Checkpoint_Load_State; Value : out BDD_Type) is
136136
begin
137137
Value.Decision := CLS.Read_SCO;
138138
Value.Root_Condition := CLS.Read_BDD_Node;
@@ -173,10 +173,10 @@ package body SC_Obligations.BDD is
173173
end Read;
174174

175175
procedure Read
176-
(CLS : access Checkpoints.Checkpoint_Load_State;
176+
(CLS : in out Checkpoints.Checkpoint_Load_State;
177177
Vector : out BDD_Vectors.Vector) is
178178
begin
179-
Read (CLS.all, Vector);
179+
Read_BDD_Vector (CLS, Vector);
180180
end Read;
181181

182182
---------------------

0 commit comments

Comments
 (0)