Node_Offsets.Table (Node_Offsets.First .. Node_Offsets.Last);
begin
- -- Empty_Or_Error use as described in types.ads
- if Destination <= Empty_Or_Error or No (Source) then
+ if Destination in Empty | Error or else No (Source) then
pragma Assert (Serious_Errors_Detected > 0);
return;
end if;
-- Start of processing for Copy_Separate_Tree
begin
- if Source <= Empty_Or_Error then
+ if Source in Empty | Error then
return Source;
elsif Is_Entity (Source) then
pragma Debug (Validate_Node (Source));
S_Size : constant Slot_Count := Size_In_Slots_To_Alloc (Source);
begin
- if Source <= Empty_Or_Error then
+ if Source in Empty | Error then
return Source;
end if;
else
End_Labl := Scopes (Scope.Last).Labl;
- if End_Labl > Empty_Or_Error then
+ if End_Labl not in Empty | Error then
-- The task here is to construct a designator from the
-- opening label, with the components all marked as not
-- Suppress message if error was posted on opening label
- if Error_Msg_Node_1 > Empty_Or_Error
+ if Error_Msg_Node_1 not in Empty | Error
and then Error_Posted (Error_Msg_Node_1)
then
return;
end if;
end if;
- if Subtype_Mark (Def) <= Empty_Or_Error then
+ if Subtype_Mark (Def) in Empty | Error then
pragma Assert (Serious_Errors_Detected > 0);
-- avoid passing bad argument to Entity
return;
-- Otherwise we have a subtype mark without a constraint
elsif Error_Posted (S) then
- -- Don't rewrite if S is Empty or Error
- if S > Empty_Or_Error then
+ if S not in Empty | Error then
Rewrite (S, New_Occurrence_Of (Any_Id, Sloc (S)));
end if;
return Any_Type;
-- If no range was given, set a dummy range
- if RRS <= Empty_Or_Error then
+ if RRS in Empty | Error then
Low_Val := -Small_Val;
High_Val := Small_Val;
Result := N;
- if N > Empty_Or_Error then
+ if N not in Empty | Error then
pragma Assert (Nkind (N) not in N_Entity);
Result := New_Copy (N);
Result := Id;
- if Id > Empty_Or_Error then
+ if Id not in Empty | Error then
pragma Assert (Nkind (Id) in N_Entity);
-- Determine whether the entity has a corresponding new entity
-- Case of descendant is a node
if D in Node_Range then
-
- -- Don't bother about Empty or Error descendants
-
- if D <= Union_Id (Empty_Or_Error) then
- return;
- end if;
-
declare
Nod : constant Node_Or_Entity_Id := Node_Or_Entity_Id (D);
begin
+ -- Don't bother about Empty or Error descendants
+
+ if Nod in Empty | Error then
+ return;
+ end if;
+
-- Descendants in one of the standardly compiled internal
-- packages are normally ignored, unless the parent is also
-- in such a package (happens when Standard itself is output)
-- Used to indicate an error in the source program. A node is actually
-- allocated with this Id value, so that Nkind (Error) = N_Error.
- Empty_Or_Error : constant Node_Id := Error;
- -- Since Empty and Error are the first two Node_Id values, the test for
- -- N <= Empty_Or_Error tests to see if N is Empty or Error. This definition
- -- provides convenient self-documentation for such tests.
-
First_Node_Id : constant Node_Id := Node_Low_Bound;
-- Subscript of first allocated node. Note that Empty and Error are both
-- allocated nodes, whose Nkind fields can be accessed without error.