Use statement SCO code 'X' to specifically identify the statement SCOs
for degenerate subprogram bodies (null procedures and expression
functions). This allows coverage analysis tools to apply specific
processing for these cases if necessary, and ensures consistency with
SCOs generated through source instrumentation.

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

2020-06-02  Thomas Quinot  <qui...@adacore.com>

gcc/ada/

        * par_sco.adb (Traverse_Degenerate_Subprogram): Set statement
        code to 'X'.
        * scos.ads: Update comment documenting SCO data.
--- gcc/ada/par_sco.adb
+++ gcc/ada/par_sco.adb
@@ -1747,7 +1747,7 @@ package body Par_SCO is
             --  chain.
 
             Current_Dominant := No_Dominant;
-            Extend_Statement_Sequence (N, Typ => ' ');
+            Extend_Statement_Sequence (N, Typ => 'X');
 
             --  For the case of an expression-function, collect decisions
             --  embedded in the expression now.

--- gcc/ada/scos.ads
+++ gcc/ada/scos.ads
@@ -162,6 +162,8 @@ package SCOs is
    --      R        extended RETURN statement
    --      S        SELECT statement
    --      W        WHILE loop statement (from WHILE to end of condition)
+   --      X        body of a degenerate subprogram (null procedure or
+   --               expression function)
 
    --      Note: for I and W, condition above is in the RM syntax sense (this
    --      condition is a decision in SCO terminology).

Reply via email to