@@ -7799,10 +7799,10 @@ package body Instrument.Ada_Unit is
77997799 -- ----------------------------------
78007800
78017801 overriding procedure Replace_Manual_Dump_Indication
7802- (Self : in out Ada_Instrumenter_Type;
7803- Done : in out Boolean ;
7804- Prj : in out Prj_Desc ;
7805- Source : GNATCOLL.Projects.File_Info )
7802+ (Self : in out Ada_Instrumenter_Type;
7803+ Prj : in out Prj_Desc ;
7804+ Source : GNATCOLL.Projects.File_Info ;
7805+ Has_Manual_Indication : out Boolean )
78067806 is
78077807 Instrumented_Filename : constant String :=
78087808 +(Prj.Output_Dir & " /" & GNATCOLL.VFS." +" (Source.File.Base_Name));
@@ -7853,7 +7853,7 @@ package body Instrument.Ada_Unit is
78537853 -- The pragma statement to be replaced by the actual call
78547854 -- to Dump_Buffers has been found.
78557855
7856- if not Done then
7856+ if not Has_Manual_Indication then
78577857 Start_Rewriting (Rewriter, Self, Prj, File_To_Search);
78587858 end if ;
78597859
@@ -7870,7 +7870,7 @@ package body Instrument.Ada_Unit is
78707870 begin
78717871 -- Add the with clause only once in the file
78727872
7873- if not Done then
7873+ if not Has_Manual_Indication then
78747874 Insert_Last
78757875 (Handle (Unit.Root.As_Compilation_Unit.F_Prelude),
78767876 Create_From_Template
@@ -7891,7 +7891,7 @@ package body Instrument.Ada_Unit is
78917891 Rule => Call_Stmt_Rule));
78927892 end ;
78937893
7894- Done := True;
7894+ Has_Manual_Indication := True;
78957895 return Over;
78967896 end if ;
78977897 end ;
@@ -7913,11 +7913,12 @@ package body Instrument.Ada_Unit is
79137913 -- initialized which will lead to finalization issues. To avoid this,
79147914 -- make sure it is set to No_Rewriting_Handle.
79157915
7916+ Has_Manual_Indication := False;
79167917 Rewriter.Handle := No_Rewriting_Handle;
79177918
79187919 Unit.Root.Traverse (Find_And_Replace_Pragma'Access );
79197920
7920- if Done then
7921+ if Has_Manual_Indication then
79217922 Create_Directory_If_Not_Exists
79227923 (GNATCOLL.VFS." +" (Source.Project.Object_Dir.Base_Dir_Name));
79237924 Create_Directory_If_Not_Exists (+Prj.Output_Dir);
0 commit comments