Commit 55e4d23d by Robert Dewar Committed by Arnaud Charlet

par_sco.adb (Is_Logical_Operator): Exclude AND/OR/XOR

2010-01-26  Robert Dewar  <dewar@adacore.com>

	* par_sco.adb (Is_Logical_Operator): Exclude AND/OR/XOR
	* scos.ads: Clarify handling of logical operators

From-SVN: r156239
parent 2593c3e1
2010-01-26 Robert Dewar <dewar@adacore.com>
* par_sco.adb (Is_Logical_Operator): Exclude AND/OR/XOR
* scos.ads: Clarify handling of logical operators
2010-01-26 Arnaud Charlet <charlet@adacore.com> 2010-01-26 Arnaud Charlet <charlet@adacore.com>
* s-tpoben.adb: Update comments. * s-tpoben.adb: Update comments.
......
...@@ -95,8 +95,9 @@ package body Par_SCO is ...@@ -95,8 +95,9 @@ package body Par_SCO is
function Is_Logical_Operator (N : Node_Id) return Boolean; function Is_Logical_Operator (N : Node_Id) return Boolean;
-- N is the node for a subexpression. This procedure just tests N to see -- N is the node for a subexpression. This procedure just tests N to see
-- if it is a logical operator (including short circuit conditions) and -- if it is a logical operator (including short circuit conditions, but
-- returns True if so, False otherwise, it does no other processing. -- excluding OR and AND) and returns True if so, False otherwise, it does
-- no other processing.
procedure Process_Decisions (N : Node_Id; T : Character); procedure Process_Decisions (N : Node_Id; T : Character);
-- If N is Empty, has no effect. Otherwise scans the tree for the node N, -- If N is Empty, has no effect. Otherwise scans the tree for the node N,
...@@ -297,9 +298,7 @@ package body Par_SCO is ...@@ -297,9 +298,7 @@ package body Par_SCO is
function Is_Logical_Operator (N : Node_Id) return Boolean is function Is_Logical_Operator (N : Node_Id) return Boolean is
begin begin
return Nkind_In (N, N_Op_And, return Nkind_In (N, N_Op_Xor,
N_Op_Or,
N_Op_Xor,
N_Op_Not, N_Op_Not,
N_And_Then, N_And_Then,
N_Or_Else); N_Or_Else);
...@@ -436,15 +435,11 @@ package body Par_SCO is ...@@ -436,15 +435,11 @@ package body Par_SCO is
begin begin
case Nkind (N) is case Nkind (N) is
-- Logical operators and short circuit forms, output table -- Logical operators, output table entries and then process
-- entries and then process operands recursively to deal with -- operands recursively to deal with nested conditions.
-- nested conditions.
when N_And_Then | when N_And_Then |
N_Or_Else | N_Or_Else |
N_Op_And |
N_Op_Or |
N_Op_Xor |
N_Op_Not => N_Op_Not =>
declare declare
......
...@@ -162,10 +162,12 @@ package SCOs is ...@@ -162,10 +162,12 @@ package SCOs is
-- Note: in the following description, logical operator includes only the -- Note: in the following description, logical operator includes only the
-- short circuited forms and NOT (so can be only NOT, AND THEN, OR ELSE). -- short circuited forms and NOT (so can be only NOT, AND THEN, OR ELSE).
-- The reason that we can exclude AND/OR/XOR is that we expect SCO's to -- The reason that we can exclude AND/OR/XOR is that we expect SCO's to
-- be generated using the restriction No_Direct_Boolean_Operators, which -- be generated using the restriction No_Direct_Boolean_Operators if we
-- does not permit the use of AND/OR/XOR on boolean operands. These are -- are interested in decision coverage, which does not permit the use of
-- permitted on modular integer types, but such operations do not count -- AND/OR/XOR on boolean operands. These are permitted on modular integer
-- as decisions in any case -- types, but such operations do not count as decisions in any case. If
-- we are generating SCO's only for simple coverage, then we are not
-- interested in decisions in any case.
-- Decisions are either simple or complex. A simple decision is a boolean -- Decisions are either simple or complex. A simple decision is a boolean
-- expresssion that occurs in the context of a control structure in the -- expresssion that occurs in the context of a control structure in the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment