Patchwork [Ada] Treat -fdump-scos as synonym of -gnateS

login
register
mail settings
Submitter Arnaud Charlet
Date June 12, 2012, 10:03 a.m.
Message ID <20120612100337.GA5728@adacore.com>
Download mbox | patch
Permalink /patch/164363/
State New
Headers show

Comments

Arnaud Charlet - June 12, 2012, 10:03 a.m.
This change allows the use of -fdump-scos as a synonym of -gnateS to
request the generation of SCOs in Ada ALI files.

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

2012-06-12  Thomas Quinot  <quinot@adacore.com>

	* back_end.adb (Scan_Back_End_Switches): Treat -fdump-scos as
	synonym of -gnateS.
	(gnat_post_options): Disable gimple-based SCO generator.
	* gnat_ugn.texi: Document that -gnateS is an obsolete synonym
	of -fdump-scos.

Patch

Index: back_end.adb
===================================================================
--- back_end.adb	(revision 188428)
+++ back_end.adb	(working copy)
@@ -6,7 +6,7 @@ 
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2011, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2012, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -219,23 +219,30 @@ 
          elsif Switch_Chars (First .. Last) = "quiet" then
             null;
 
-         --  Store any other GCC switches
+         --  Store any other GCC switches. Also do special processing for some
+         --  specific switches that the Ada front-end knows about.
 
          else
             Store_Compilation_Switch (Switch_Chars);
 
-            --  Special check, the back end switch -fno-inline also sets the
+            --  Back end switch -fno-inline also sets the Suppress_All_Inlining
             --  front end flag to entirely inhibit all inlining.
 
             if Switch_Chars (First .. Last) = "fno-inline" then
                Opt.Suppress_All_Inlining := True;
 
-            --  Another special check, the switch -fpreserve-control-flow
-            --  which is also a back end switch sets the front end flag
-            --  that inhibits improper control flow transformations.
+            --  Back end switch -fpreserve-control-flow also sets the front end
+            --  flag that inhibits improper control flow transformations.
 
             elsif Switch_Chars (First .. Last) = "fpreserve-control-flow" then
                Opt.Suppress_Control_Flow_Optimizations := True;
+
+            --  Back end switcg -fdump-scos, which exists primarily for C, is
+            --  also accepted for Ada as a synonym of -gnateS.
+
+            elsif Switch_Chars (First .. Last) = "fdump-scos" then
+               Opt.Generate_SCO := True;
+
             end if;
          end if;
       end Scan_Back_End_Switches;
Index: gnat_ugn.texi
===================================================================
--- gnat_ugn.texi	(revision 188428)
+++ gnat_ugn.texi	(working copy)
@@ -4045,6 +4045,13 @@ 
 per-file basis.  The information is generated in the VCG format.  It can
 be decorated with stack-usage per-node information.
 
+@item -fdump-scos
+@cindex @option{-fdump-scos} (@command{gcc})
+Generate SCO (Source Coverage Obligation) information in the ALI file.
+This information is used by advanced coverage tools. See unit @file{SCOs}
+in the compiler sources for details in files @file{scos.ads} and
+@file{scos.adb}.
+
 @item ^-g^/DEBUG^
 @cindex @option{^-g^/DEBUG^} (@command{gcc})
 Generate debugging information. This information is stored in the object
@@ -4201,12 +4208,10 @@ 
 these errors become warnings (which can be ignored, or suppressed in the usual
 manner). This can be useful in some specialized circumstances such as the
 temporary use of special test software.
+
 @item -gnateS
 @cindex @option{-gnateS} (@command{gcc})
-Generate SCO (Source Coverage Obligation) information in the ALI
-file. This information is used by advanced coverage tools. See
-unit @file{SCOs} in the compiler sources for details in files
-@file{scos.ads} and @file{scos.adb}.
+Synonym of @option{-fdump-scos}, kept for backards compatibility.
 
 @item -gnatE
 @cindex @option{-gnatE} (@command{gcc})