@@ -147,9 +147,7 @@ package body SC_Obligations is
147147 procedure Read
148148 (S : access Root_Stream_Type'Class;
149149 V : out CU_Info);
150- procedure Write
151- (S : access Root_Stream_Type'Class;
152- V : CU_Info);
150+ procedure Write (S : access Root_Stream_Type'Class; V : CU_Info);
153151 pragma Warnings (On, " * is not referenced" );
154152
155153 for CU_Info'Read use Read;
@@ -813,7 +811,6 @@ package body SC_Obligations is
813811 is
814812 Relocs : Checkpoint_Relocations renames CLS.Relocations;
815813 Real_CU : CU_Info renames CU_Vector.Reference (Real_CU_Id).Element.all ;
816- S : constant access Root_Stream_Type'Class := CLS.all 'Access ;
817814 begin
818815 -- Here we already have loaded full SCO information for this CU, so
819816 -- all we need to do is to populate the tables mapping the SCO and
@@ -856,7 +853,7 @@ package body SC_Obligations is
856853
857854 -- Non-Instrumented SCO sets
858855
859- if Version_Less (S, Than => 9 ) then
856+ if CLS. Version_Less (Than => 9 ) then
860857
861858 -- Nothing to do
862859 return ;
@@ -938,7 +935,6 @@ package body SC_Obligations is
938935 New_CU_Id : out CU_Id)
939936 is
940937 Relocs : Checkpoint_Relocations renames CLS.Relocations;
941- S : constant access Root_Stream_Type'Class := CLS.all 'Access ;
942938
943939 New_First_Instance : Inst_Id;
944940 New_First_SCO : SCO_Id;
@@ -1275,7 +1271,7 @@ package body SC_Obligations is
12751271 -- belong to a CU already present in the current execution, and which
12761272 -- would not be simply imported as is.
12771273
1278- if not Version_Less (S, Than => 9 ) then
1274+ if not CLS. Version_Less (Than => 9 ) then
12791275 for SCO of CP_Vectors.Non_Instr_SCOs loop
12801276 if SCO in CP_CU.First_SCO .. CP_CU.Last_SCO then
12811277 Non_Instr_SCOs.Insert (Remap_SCO_Id (Relocs, SCO));
@@ -1465,8 +1461,10 @@ package body SC_Obligations is
14651461 (S : access Root_Stream_Type'Class;
14661462 V : out CU_Info)
14671463 is
1464+ CLS : Stateful_Stream renames Stateful_Stream (S.all );
1465+
14681466 Provider : constant SCO_Provider :=
1469- (if Version_Less (S, Than => 2 )
1467+ (if CLS. Version_Less (Than => 2 )
14701468 then Compiler else SCO_Provider'Input (S));
14711469 -- Discriminant for v2 data
14721470
@@ -1493,7 +1491,7 @@ package body SC_Obligations is
14931491
14941492 -- Checkpoint version 8 preprocessing information
14951493
1496- if not Version_Less (S, Than => 8 ) then
1494+ if not CLS. Version_Less (Than => 8 ) then
14971495 SCO_PP_Info_Maps.Map'Read (S, V.PP_Info_Map);
14981496 end if ;
14991497
@@ -1514,24 +1512,24 @@ package body SC_Obligations is
15141512
15151513 V.Bit_Maps_Fingerprint := No_Fingerprint;
15161514
1517- if not Version_Less (S, Than => 2 )
1518- and then Purpose_Of (S) = Instrumentation
1515+ if not CLS. Version_Less (Than => 2 )
1516+ and then CLS. Purpose_Of = Instrumentation
15191517 then
15201518 V.Bit_Maps.Statement_Bits :=
15211519 new Statement_Bit_Map'(Statement_Bit_Map'Input (S));
15221520 V.Bit_Maps.Decision_Bits :=
15231521 new Decision_Bit_Map'(Decision_Bit_Map'Input (S));
15241522 V.Bit_Maps.MCDC_Bits :=
15251523 new MCDC_Bit_Map'(MCDC_Bit_Map'Input (S));
1526- if not Version_Less (S, Than => 11 ) then
1524+ if not CLS. Version_Less (Than => 11 ) then
15271525 Fingerprint_Type'Read (S, V.Bit_Maps_Fingerprint);
15281526 end if ;
15291527 end if ;
15301528 end case ;
15311529
15321530 -- Checkpoint version 8 data (scoped metrics support)
15331531
1534- if not Version_Less (S, Than => 8 ) then
1532+ if not CLS. Version_Less (Than => 8 ) then
15351533 Scope_Entities_Tree'Read (S, V.Scope_Entities);
15361534 end if ;
15371535 end Read ;
@@ -1540,10 +1538,8 @@ package body SC_Obligations is
15401538 -- Write --
15411539 -- ---------
15421540
1543- procedure Write
1544- (S : access Root_Stream_Type'Class;
1545- V : CU_Info)
1546- is
1541+ procedure Write (S : access Root_Stream_Type'Class; V : CU_Info) is
1542+ CLS : Stateful_Stream renames Stateful_Stream (S.all );
15471543 begin
15481544 SCO_Provider'Write (S, V.Provider);
15491545
@@ -1565,7 +1561,7 @@ package body SC_Obligations is
15651561 when Compiler =>
15661562 null ;
15671563 when Instrumenter =>
1568- if Purpose_Of (S) = Instrumentation then
1564+ if CLS. Purpose_Of = Instrumentation then
15691565 Statement_Bit_Map'Output
15701566 (S, V.Bit_Maps.Statement_Bits.all );
15711567 Decision_Bit_Map'Output
@@ -1598,7 +1594,7 @@ package body SC_Obligations is
15981594
15991595 -- Load non-instrumented information
16001596
1601- if not Version_Less (S, Than => 9 ) then
1597+ if not CLS. Version_Less (Than => 9 ) then
16021598 SCO_Sets.Set'Read (S, CP_Vectors.Non_Instr_SCOs);
16031599 SCO_Sets.Set'Read
16041600 (S, CP_Vectors.Non_Instr_MCDC_SCOs);
@@ -3898,6 +3894,7 @@ package body SC_Obligations is
38983894
38993895 procedure Read (S : access Root_Stream_Type'Class; V : out SCO_Descriptor)
39003896 is
3897+ CLS : Stateful_Stream renames Stateful_Stream (S.all );
39013898 SCOD : SCO_Descriptor (SCO_Kind'Input (S));
39023899 begin
39033900 if SCOD.Kind = Removed then
@@ -3932,7 +3929,7 @@ package body SC_Obligations is
39323929 -- Before version 2, decisions shared Operations's Operand member,
39333930 -- and stored the expression as its Right array item.
39343931
3935- if Version_Less (S, Than => 2 ) then
3932+ if CLS. Version_Less (Than => 2 ) then
39363933 declare
39373934 Operands : constant Operand_Pair := Operand_Pair'Input (S);
39383935 begin
0 commit comments