procedure Remove_Warning_Messages (L : List_Id) is
Stat : Node_Id;
begin
- if Is_Non_Empty_List (L) then
- Stat := First (L);
- while Present (Stat) loop
- Remove_Warning_Messages (Stat);
- Next (Stat);
- end loop;
- end if;
+ Stat := First (L);
+ while Present (Stat) loop
+ Remove_Warning_Messages (Stat);
+ Next (Stat);
+ end loop;
end Remove_Warning_Messages;
--------------------
begin
W := Warn;
- if Is_Non_Empty_List (L) then
- N := First (L);
- while Present (N) loop
- Kill_Dead_Code (N, W);
- W := False;
- Next (N);
- end loop;
- end if;
+ N := First (L);
+ while Present (N) loop
+ Kill_Dead_Code (N, W);
+ W := False;
+ Next (N);
+ end loop;
end Kill_Dead_Code;
-----------------------------
-- Loop through statements or declarations
- if Is_Non_Empty_List (L) then
- N := First (L);
- while Present (N) loop
+ N := First (L);
+ while Present (N) loop
- -- Note: For separate bodies, we see the tree after Par.Labl has
- -- introduced implicit labels, so we need to ignore those nodes.
+ -- Note: For separate bodies, we see the tree after Par.Labl has
+ -- introduced implicit labels, so we need to ignore those nodes.
- if Nkind (N) /= N_Implicit_Label_Declaration then
- Traverse_One (N);
- end if;
-
- Next (N);
- end loop;
+ if Nkind (N) /= N_Implicit_Label_Declaration then
+ Traverse_One (N);
+ end if;
- end if;
+ Next (N);
+ end loop;
-- End sequence of statements and flush deferred decisions
declare
Iface : Node_Id;
begin
- if Is_Non_Empty_List (Interface_List (Type_Def)) then
- Iface := First (Interface_List (Type_Def));
- while Present (Iface) loop
- Freeze_Before (N, Etype (Iface));
- Next (Iface);
- end loop;
- end if;
+ Iface := First (Interface_List (Type_Def));
+ while Present (Iface) loop
+ Freeze_Before (N, Etype (Iface));
+ Next (Iface);
+ end loop;
end;
end if;
begin
Error := False;
- if Is_Non_Empty_List (Intface_List) then
- Intface := First (Intface_List);
- while Present (Intface) loop
+ Intface := First (Intface_List);
+ while Present (Intface) loop
- -- Look for acceptable class-wide homonyms associated with
- -- the interface.
+ -- Look for acceptable class-wide homonyms associated with the
+ -- interface.
- Traverse_Homonyms (Etype (Intface), Error);
+ Traverse_Homonyms (Etype (Intface), Error);
- if Error then
- return;
- end if;
+ if Error then
+ return;
+ end if;
- -- Continue the search by looking at each of the interface's
- -- associated interface ancestors.
+ -- Continue the search by looking at each of the interface's
+ -- associated interface ancestors.
- Traverse_Interfaces (Etype (Intface), Error);
+ Traverse_Interfaces (Etype (Intface), Error);
- if Error then
- return;
- end if;
+ if Error then
+ return;
+ end if;
- Next (Intface);
- end loop;
- end if;
+ Next (Intface);
+ end loop;
end Traverse_Interfaces;
-- Start of processing for Try_Class_Wide_Operation
procedure Why_Not_Static_List (L : List_Id) is
N : Node_Id;
begin
- if Is_Non_Empty_List (L) then
- N := First (L);
- while Present (N) loop
- Why_Not_Static (N);
- Next (N);
- end loop;
- end if;
+ N := First (L);
+ while Present (N) loop
+ Why_Not_Static (N);
+ Next (N);
+ end loop;
end Why_Not_Static_List;
-- Start of processing for Why_Not_Static
-- Traverse the graph of ancestor interfaces
- if Is_Non_Empty_List (Abstract_Interface_List (Full_T)) then
- Id := First (Abstract_Interface_List (Full_T));
- while Present (Id) loop
- Iface := Etype (Id);
-
- -- Protect against wrong uses. For example:
- -- type I is interface;
- -- type O is tagged null record;
- -- type Wrong is new I and O with null record; -- ERROR
-
- if Is_Interface (Iface) then
- if Exclude_Parents
- and then Etype (T) /= T
- and then Interface_Present_In_Ancestor (Etype (T), Iface)
- then
- null;
- else
- Collect (Iface);
- Append_Unique_Elmt (Iface, Ifaces_List);
- end if;
+ Id := First (Abstract_Interface_List (Full_T));
+ while Present (Id) loop
+ Iface := Etype (Id);
+
+ -- Protect against wrong uses. For example:
+ -- type I is interface;
+ -- type O is tagged null record;
+ -- type Wrong is new I and O with null record; -- ERROR
+
+ if Is_Interface (Iface) then
+ if Exclude_Parents
+ and then Etype (T) /= T
+ and then Interface_Present_In_Ancestor (Etype (T), Iface)
+ then
+ null;
+ else
+ Collect (Iface);
+ Append_Unique_Elmt (Iface, Ifaces_List);
end if;
+ end if;
- Next (Id);
- end loop;
- end if;
+ Next (Id);
+ end loop;
end Collect;
-- Start of processing for Collect_Interfaces
Node : Node_Id;
begin
- if Is_Non_Empty_List (L) then
- Node := First (L);
+ Node := First (L);
- loop
- if Nkind (Node) not in N_Null_Statement | N_Call_Marker then
- return True;
- end if;
+ while Present (Node) loop
+ if Nkind (Node) not in N_Null_Statement | N_Call_Marker then
+ return True;
+ end if;
- Next (Node);
- exit when Node = Empty;
- end loop;
- end if;
+ Next (Node);
+ end loop;
return False;
end Has_Non_Null_Statements;
Node : Node_Id;
begin
- if Is_Non_Empty_List (L) then
- Node := First (L);
+ Node := First (L);
- loop
- case Nkind (Node) is
- when N_Null_Statement | N_Call_Marker | N_Raise_xxx_Error =>
- null;
- when N_Object_Declaration =>
- if Present (Expression (Node))
- and then not Side_Effect_Free (Expression (Node))
- then
- return False;
- end if;
+ while Present (Node) loop
+ case Nkind (Node) is
+ when N_Null_Statement | N_Call_Marker | N_Raise_xxx_Error =>
+ null;
- when others =>
+ when N_Object_Declaration =>
+ if Present (Expression (Node))
+ and then not Side_Effect_Free (Expression (Node))
+ then
return False;
- end case;
+ end if;
- Next (Node);
- exit when Node = Empty;
- end loop;
- end if;
+ when others =>
+ return False;
+ end case;
+
+ Next (Node);
+ end loop;
return True;
end Side_Effect_Free_Statements;