diff mbox series

[Ada] Reset internal flags for -gnatD and -gnatG

Message ID 20211202162909.GA2160003@adacore.com
State New
Headers show
Series [Ada] Reset internal flags for -gnatD and -gnatG | expand

Commit Message

Pierre-Marie de Rodat Dec. 2, 2021, 4:29 p.m. UTC
This resets the internal flags associated with the -gnatD and -gnatG
switches once the generated code is printed, so that it does not end
up being printed twice in case something goes wrong after this point.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* sprint.adb (Source_Dump): Set both Print_Generated_Code and
	Debug_Generated_Code to False at the end.
diff mbox series

Patch

diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb
--- a/gcc/ada/sprint.adb
+++ b/gcc/ada/sprint.adb
@@ -673,6 +673,11 @@  package body Sprint is
             end if;
          end loop;
       end if;
+
+      --  See above for the rationale, but we cannot do it earlier for them
+
+      Print_Generated_Code := False;
+      Debug_Generated_Code := False;
    end Source_Dump;
 
    ---------------------