aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_dbug.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/exp_dbug.adb')
-rw-r--r--gcc/ada/exp_dbug.adb8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/ada/exp_dbug.adb b/gcc/ada/exp_dbug.adb
index 388d247..f0df5e2 100644
--- a/gcc/ada/exp_dbug.adb
+++ b/gcc/ada/exp_dbug.adb
@@ -914,6 +914,14 @@ package body Exp_Dbug is
-- names produced for Ghost entities, while "__ghost_" can appear in
-- names of entities inside a child/local package called "Ghost".
+ -- The compiler-generated finalizer for an enabled Ghost unit is treated
+ -- specially, as its name must be known to the binder, which has no
+ -- knowledge of Ghost status. In that case, the finalizer is not marked
+ -- as Ghost so that no prefix is added. Note that the special ___ghost_
+ -- prefix is retained when the Ghost unit is ignored, which still allows
+ -- inspecting the final executable for the presence of an ignored Ghost
+ -- finalizer procedure.
+
if Is_Ghost_Entity (E)
and then not Is_Compilation_Unit (E)
and then (Name_Len < 9