From: Michael Beck Date: Thu, 21 Aug 2008 10:56:42 +0000 (+0000) Subject: - sticky methods can be called from outside (by inline ASM for instance) and are... X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=111b1d34beb7338214ed647215baf17a7ea2f15c;p=libfirm - sticky methods can be called from outside (by inline ASM for instance) and are NOT private [r21307] --- diff --git a/include/libfirm/typerep.h b/include/libfirm/typerep.h index 62efc2403..b57056583 100644 --- a/include/libfirm/typerep.h +++ b/include/libfirm/typerep.h @@ -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. */ diff --git a/ir/ana/irmemory.c b/ir/ana/irmemory.c index c3f8503d9..720e6de1c 100644 --- a/ir/ana/irmemory.c +++ b/ir/ana/irmemory.c @@ -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);