[Ada] Don't expect enumeration literals to be renamings
Commit Message
When using cross-reference information to get subprogram effects in
SPARK (i.e. its reads and writes), we were calling Renamed_Object on
enumeration literals. This was pointless but harmless; now it rightly
triggers an assertion failure in developer builds, so avoid that.
Tested on x86_64-pc-linux-gnu, committed on trunk
gcc/ada/
* lib-xref.adb (Get_Through_Renamings): Exit loop when an
enumeration literal is found.
@@ -481,7 +481,9 @@ package body Lib.Xref is
-- e.g. function call, slicing of a function call,
-- pointer dereference, etc.
- if No (Obj) then
+ if No (Obj)
+ or else Ekind (Obj) = E_Enumeration_Literal
+ then
return Empty;
end if;
else