- sticky methods can be called from outside (by inline ASM for instance) and are...
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 21 Aug 2008 10:56:42 +0000 (10:56 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 21 Aug 2008 10:56:42 +0000 (10:56 +0000)
[r21307]

include/libfirm/typerep.h
ir/ana/irmemory.c

index 62efc24..b570565 100644 (file)
@@ -326,11 +326,12 @@ const char *get_align_name(ir_align a);
 
 /** This enumeration flags the stickyness of an entity. */
 typedef enum {
-       stickyness_unsticky,          /**< The entity can be removed from
-                                        the program, unless contraindicated
-                                        by other attributes. Default. */
-       stickyness_sticky             /**< The entity must remain in the
-                                        program in any case. */
+       stickyness_unsticky,  /**< The entity can be removed from
+                                  the program, unless contraindicated
+                                  by other attributes. Default. */
+       stickyness_sticky     /**< The entity must remain in the
+                                  program in any case. There might be external
+                                  callers. */
 } ir_stickyness;
 
 /** Get the entity's stickyness. */
index c3f8503..720e6de 100644 (file)
@@ -1142,8 +1142,11 @@ void mark_private_methods(void) {
                ir_entity              *ent = get_irg_entity(irg);
                ir_address_taken_state state = get_entity_address_taken(ent);
 
+               /* If an entity is sticky, it might be called from external
+                  places (like inline assembler), so do NOT mark it as private. */
                if (get_entity_visibility(ent) == visibility_local &&
-                   state == ir_address_not_taken) {
+                   state == ir_address_not_taken &&
+                   get_entity_stickyness(ent) != stickyness_sticky) {
                        ir_type *mtp = get_entity_type(ent);
 
                        set_entity_additional_property(ent, mtp_property_private);