212212 -- Split_Args --
213213 -- --------------
214214
215- function Split_Args (Command : String) return String_Vectors.Vector
216- is
217- Arg : Unbounded_String;
215+ function Split_Args (Command : String) return String_Vectors.Vector is
216+ Arg : Unbounded_String;
218217 Result : String_Vectors.Vector;
219218 begin
220219 for C of Command loop
260259 Commands_Filename : constant String :=
261260 Tmp_Dir.Directory_Name / " commands" ;
262261 begin
263- -- Expand the command line using gcc's -### option. TODO??? check if
264- -- the command we are intercepting is a compile / link target and not
265- -- a preprocessing / -### action.
262+ -- Expand the command line using gcc's -### option. TODO??? check if the
263+ -- command we are intercepting is a compile / link target and not a
264+ -- preprocessing / -### action.
266265
267266 Run_Command
268267 (+Context.Orig_Compiler_Driver,
272271
273272 -- Then, parse the files containing the list of launched commands, using
274273 -- the following heuristics:
274+ --
275275 -- * If the command is a cc1 invocation (first argument end with cc1),
276276 -- assume compilation command.
277277 -- * If the command is an as invocation, assume assembly command.
278- -- * If the command is a collect2 invocation, assume link command
278+ -- * If the command is a collect2 invocation, assume link command.
279279
280280 declare
281281 Commands_File : File_Type;
282282 begin
283283 Open (Commands_File, In_File, Commands_Filename);
284284 while not End_Of_File (Commands_File) loop
285285 declare
286- Line : constant String := Get_Line (Commands_File);
286+ Line : constant String := Get_Line (Commands_File);
287287 Command : constant String_Vectors.Vector := Split_Args (Line);
288288 begin
289289 if Line = " " then
353353 Arg : constant Unbounded_String :=
354354 String_Vectors.Element (Cur);
355355 begin
356- -- Skip switches arguments that look like filenames. Ideally,
357- -- we would find the positional argument but it is not
356+ -- Skip switches arguments that look like filenames. Ideally, we
357+ -- would find the positional argument but it is not
358358 -- straightforward.
359359
360360 if Arg = +" -dumpbase" or else Arg = +" -dumpbase-ext" then
523523 Args.Append (+Symbol_File);
524524
525525 -- The command can fail with e.g. "file format not recognized" for
526- -- system libraries. TODO???: investigate why. We should also avoid
526+ -- system libraries. TODO??? investigate why. We should also avoid
527527 -- invoking nm on system libraries altogether.
528528
529529 Ignore_Success :=
542542 while not End_Of_File (Output_File) loop
543543 declare
544544 Line_Str : constant String := Get_Line (Output_File);
545- Line : constant Unbounded_String := +Line_Str;
545+ Line : constant Unbounded_String := +Line_Str;
546546 begin
547547 if Starts_With (Line, " gnatcov_rts_buffers" )
548548
639639
640640 Instr_Config_File : constant String :=
641641 Compiler_Wrapper_Dir / Instrumentation_Config_Filename;
642- Instr_Config : Instrumentation_Config :=
642+ Instr_Config : Instrumentation_Config :=
643643 Load_Config (Instr_Config_File);
644644 -- Instrumentation configuration previously generated by the setup step
645645
664664 Instrumented_Files : String_Sets.Set;
665665 -- List of instrumented files (files of interest / main files / both)
666666
667+ -- Start of processing for Compiler_Wrappers.GCC
668+
667669begin
668670 Create_Temporary_Directory
669671 (Instr_Dir, " gnatcov_instr" , Auto_Delete => not Switches.Save_Temps);
@@ -724,12 +726,12 @@ begin
724726 Comp_DB.Compilation_Commands.Reference (Cur);
725727 Instrumenter : Language_Instrumenter'Class :=
726728 (case Comp_Command.Language is
727- when C_Language => Create_C_Instrumenter (Instr_Config.Tag),
728- when CPP_Language => Create_CPP_Instrumenter (Instr_Config.Tag),
729- when others =>
730- raise Program_Error
731- with " Unsupported language for integrated"
732- & " instrumentation" );
729+ when C_Language => Create_C_Instrumenter (Instr_Config.Tag),
730+ when CPP_Language => Create_CPP_Instrumenter (Instr_Config.Tag),
731+ when others =>
732+ raise Program_Error
733+ with " Unsupported language for integrated"
734+ & " instrumentation" );
733735
734736 Fullname : constant String :=
735737 Ada.Directories.Full_Name (+Comp_Command.Filename);
@@ -752,7 +754,7 @@ begin
752754 Unit_Name => Fullname,
753755
754756 -- Generate all the SID files under the same directory as the
755- -- compiler wrapper as they must persist. TODO???: deal with
757+ -- compiler wrapper as they must persist. TODO??? deal with
756758 -- homonym files in SID names.
757759
758760 SID_Name => Compiler_Wrapper_Dir / (Simple_Name & " .sid" ));
@@ -809,9 +811,7 @@ begin
809811 Config => Instr_Config);
810812 begin
811813 Buffers_List_Unit :=
812- Instrumenter.Emit_Buffers_List_Unit
813- (Buffer_Symbols,
814- Prj);
814+ Instrumenter.Emit_Buffers_List_Unit (Buffer_Symbols, Prj);
815815 end ;
816816 end if ;
817817
@@ -845,8 +845,8 @@ begin
845845 begin
846846 if Ada.Directories.Exists (+Arg) then
847847 declare
848- Base : constant String := Simple_Name (+Arg);
849- Fullname : constant String := Full_Name (+Arg);
848+ Base : constant String := Simple_Name (+Arg);
849+ Fullname : constant String := Full_Name (+Arg);
850850 begin
851851 if Instrumented_Files.Contains (+Fullname) then
852852 New_Args.Replace_Element (I, +(Output_Dir / Base));
@@ -923,7 +923,7 @@ begin
923923 Packaged_Name : constant String :=
924924 New_File
925925 (Prj, " instr_" & Filename_Slug (+Orig_Source) & " .a" );
926- Success : Boolean;
926+ Success : Boolean;
927927 begin
928928 if not Instr_Objects.Is_Empty then
929929 declare
@@ -941,9 +941,9 @@ begin
941941 Arguments => Args_Ld,
942942 Origin_Command_Name => " compiler wrapper" );
943943
944- -- Finally, replace the original object file with
945- -- the newly created library file, packaging both
946- -- the instrumented source and its coverage buffer.
944+ -- Finally, replace the original object file with the
945+ -- newly created library file, packaging both the
946+ -- instrumented source and its coverage buffer.
947947
948948 GNAT.OS_Lib.Copy_File
949949 (Packaged_Name,
0 commit comments