add entity_has_ld_ident function
authorMatthias Braun <matze@braunis.de>
Wed, 17 Nov 2010 12:00:07 +0000 (12:00 +0000)
committerMatthias Braun <matze@braunis.de>
Wed, 17 Nov 2010 12:00:07 +0000 (12:00 +0000)
[r28141]

include/libfirm/typerep.h
ir/tr/entity.c

index ca6b948..9c95e13 100644 (file)
@@ -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);
 
index dbef0ed..0ac5c68 100644 (file)
@@ -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);