@@ -23,7 +23,6 @@ with Ada.Containers.Ordered_Maps;
2323with Ada.Directories ;
2424with Ada.Streams ; use Ada.Streams;
2525with Ada.Strings.Unbounded ;
26- with Ada.Tags ;
2726with Ada.Unchecked_Deallocation ;
2827
2928with Interfaces ;
@@ -477,10 +476,6 @@ package body Coverage.Source is
477476 procedure Checkpoint_Load (CLS : access Checkpoint_Load_State) is
478477 use SCI_Vector_Vectors;
479478
480- Stream_Tags : constant Boolean := not CLS.Version_Less (Than => 2 );
481- -- Before version 2, we streamed mere tags in the checkpoint. We stream
482- -- tag provider names since then.
483-
484479 CP_Tag_Provider : Unbounded_String;
485480 CP_SCI_Vector : SCI_Vector_Vectors.Vector;
486481 Relocs : Checkpoint_Relocations renames CLS.Relocations;
@@ -491,23 +486,7 @@ package body Coverage.Source is
491486 -- tag provider is the default (i.e. no coverage separation), or same
492487 -- as checkpoint.
493488
494- if Stream_Tags then
495- CP_Tag_Provider := To_Unbounded_String (String'Input (CLS));
496- else
497- declare
498- Tag : Ada.Tags.Tag;
499- begin
500- Ada.Tags.Tag'Read (CLS, Tag);
501- CP_Tag_Provider := To_Unbounded_String (Tag_Providers.Name (Tag));
502- exception
503- when Constraint_Error =>
504- Warn (" cannot read " & To_String (CLS.Filename)
505- & " , it was produced with an incompatible version of "
506- & " gnatcov" );
507- CP_Tag_Provider := To_Unbounded_String (" <unknown>" );
508- end ;
509- end if ;
510-
489+ CP_Tag_Provider := To_Unbounded_String (String'Input (CLS));
511490 if Tag_Provider.all not in Default_Tag_Provider_Type
512491 and then Tag_Provider_Name /= To_String (CP_Tag_Provider)
513492 then
@@ -569,48 +548,21 @@ package body Coverage.Source is
569548
570549 if CLS.Purpose = Consolidation then
571550
572- -- Before version 3, this list was not streamed. In this case, be
573- -- conservative and consider that we don't have a valid list.
574-
575- if CLS.Version_Less (Than => 3 ) then
576- Invalidate_Unit_List
577- (US.To_String (CLS.Filename)
578- & " does not contain the list of units (obsolete format)" );
579-
580- else
581- declare
582- Invalidated : constant Boolean := Boolean'Input (CLS);
583- Obsolete : constant Boolean := CLS.Version_Less (Than => 12 );
584- Dummy : US.Unbounded_String;
585- begin
586- if Invalidated then
587- Invalidate_Unit_List
588- (US.To_String (CLS.Filename)
589- & " does not contain the list of units (produced with"
590- & " --scos or --sid)" );
591- else
592- for I in 1 .. Ada.Containers.Count_Type'Input (CLS) loop
593-
594- -- From version 3 up to version 11, Unit_List used to
595- -- be a set of unbounded strings, and did not support
596- -- homonym source files. If we are in that case, read the
597- -- old Unit_List from the checkpoint and then discard it.
598-
599- if Obsolete then
600- if I = 1 then
601- Invalidate_Unit_List
602- (US.To_String (CLS.Filename)
603- & " does not contain the list of units (obsolete"
604- & " format)" );
605- end if ;
606- US.Unbounded_String'Read (CLS, Dummy);
607- else
608- Unit_List.Include (Compilation_Unit'Input (CLS));
609- end if ;
610- end loop ;
611- end if ;
612- end ;
613- end if ;
551+ declare
552+ Invalidated : constant Boolean := Boolean'Input (CLS);
553+ Dummy : US.Unbounded_String;
554+ begin
555+ if Invalidated then
556+ Invalidate_Unit_List
557+ (US.To_String (CLS.Filename)
558+ & " does not contain the list of units (produced with --scos"
559+ & " or --sid)" );
560+ else
561+ for I in 1 .. Ada.Containers.Count_Type'Input (CLS) loop
562+ Unit_List.Include (Compilation_Unit'Input (CLS));
563+ end loop ;
564+ end if ;
565+ end ;
614566 end if ;
615567 end Checkpoint_Load ;
616568
0 commit comments