if Nkind (Templ) = N_Generic_Package_Declaration then
Mutate_Ekind (Templ_Id, E_Generic_Package);
- if Present (Visible_Declarations (Specification (Templ))) then
- Decl := First (Visible_Declarations (Specification (Templ)));
- end if;
+ Decl := First (Visible_Declarations (Specification (Templ)));
-- A generic package body carries contract-related source pragmas in its
-- declarations.
elsif Nkind (Templ) = N_Package_Body then
Mutate_Ekind (Templ_Id, E_Package_Body);
- if Present (Declarations (Templ)) then
- Decl := First (Declarations (Templ));
- end if;
+ Decl := First (Declarations (Templ));
-- Generic subprogram declaration
-- the Pragmas_After list for contract-related source pragmas.
if Nkind (Context) = N_Compilation_Unit then
- if Present (Aux_Decls_Node (Context))
- and then Present (Pragmas_After (Aux_Decls_Node (Context)))
- then
+ if Present (Aux_Decls_Node (Context)) then
Decl := First (Pragmas_After (Aux_Decls_Node (Context)));
end if;
elsif Nkind (Templ) = N_Subprogram_Body then
Mutate_Ekind (Templ_Id, E_Subprogram_Body);
- if Present (Declarations (Templ)) then
- Decl := First (Declarations (Templ));
- end if;
+ Decl := First (Declarations (Templ));
end if;
-- Inspect the relevant declarations looking for contract-related source
-- Find if there is a named association, and verify that no positional
-- associations appear after named ones.
- if Present (Actuals) then
- Actual := First (Actuals);
- end if;
+ Actual := First (Actuals);
while Present (Actual)
and then Nkind (Actual) /= N_Parameter_Association
Next (Actual);
end loop;
- if Present (Actuals) then
- Actual := First (Actuals);
- end if;
-
+ Actual := First (Actuals);
Formal := First_Formal (S);
while Present (Formal) loop