Avoid potentially unnecessary call to Etype.
gcc/ada/
* sem_util.adb (Get_Actual_Subtype_If_Available): Only call Etype
when necessary.
-------------------------------------
function Get_Actual_Subtype_If_Available (N : Node_Id) return Entity_Id is
- Typ : constant Entity_Id := Etype (N);
-
begin
-- If what we have is an identifier that references a subprogram
-- formal, or a variable or constant object, then we get the actual
-- Otherwise the Etype of N is returned unchanged
else
- return Typ;
+ return Etype (N);
end if;
end Get_Actual_Subtype_If_Available;