From: Matthias Braun Date: Wed, 17 Nov 2010 12:00:07 +0000 (+0000) Subject: add entity_has_ld_ident function X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=f0e275de213de26683e4bcf9738c0fbb5693d54b;p=libfirm add entity_has_ld_ident function [r28141] --- diff --git a/include/libfirm/typerep.h b/include/libfirm/typerep.h index ca6b94807..9c95e1359 100644 --- a/include/libfirm/typerep.h +++ b/include/libfirm/typerep.h @@ -110,7 +110,7 @@ typedef enum { /** * linkage specifies how the linker treats symbols */ -typedef enum { +typedef enum ir_linkage { IR_LINKAGE_DEFAULT = 0, /** * A symbol whose definition won't change in a program. @@ -251,6 +251,9 @@ FIRM_API void set_entity_ld_ident(ir_entity *ent, ident *ld_ident); /** Returns the mangled name of the entity as a string. */ FIRM_API const char *get_entity_ld_name(const ir_entity *ent); +/** returns 1 if the entity has an ld_ident set explicitely */ +FIRM_API int entity_has_ld_ident(const ir_entity *entity); + /** Returns the owner of the entity. */ FIRM_API ir_type *get_entity_owner(const ir_entity *ent); diff --git a/ir/tr/entity.c b/ir/tr/entity.c index dbef0ed08..0ac5c6828 100644 --- a/ir/tr/entity.c +++ b/ir/tr/entity.c @@ -301,6 +301,11 @@ const char *(get_entity_ld_name)(const ir_entity *ent) return _get_entity_ld_name(ent); } +int entity_has_ld_ident(const ir_entity *entity) +{ + return entity->ld_name != NULL; +} + ir_type *(get_entity_type)(const ir_entity *ent) { return _get_entity_type(ent);