libFirm
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Entities

An entity is the representation of program known objects in Firm. More...

Modules

 Entity Initializers
 

Macros

#define IR_VTABLE_NUM_NOT_SET   ((unsigned)(-1))
 A reserved value for "not yet set". More...
 
#define IR_VA_START_PARAMETER_NUMBER   ((size_t)-1)
 Sepcial parameter number which can be used for parameter entities to indicate the first non-declared parameter in a procedure with variable arguments. More...
 

Typedefs

typedef struct ir_entity ir_entity
 Entity. More...
 

Enumerations

enum  ir_visibility {
  ir_visibility_external, ir_visibility_external_private, ir_visibility_external_protected, ir_visibility_local,
  ir_visibility_private
}
 Visibility classed for entities. More...
 
enum  ir_linkage {
  IR_LINKAGE_DEFAULT = 0, IR_LINKAGE_CONSTANT = 1 << 0, IR_LINKAGE_WEAK = 1 << 1, IR_LINKAGE_GARBAGE_COLLECT = 1 << 2,
  IR_LINKAGE_MERGE = 1 << 3, IR_LINKAGE_HIDDEN_USER = 1 << 4, IR_LINKAGE_NO_CODEGEN = 1 << 5, IR_LINKAGE_NO_IDENTITY = 1 << 6
}
 linkage specifies how the linker treats symbols More...
 
enum  ir_entity_usage {
  ir_usage_none = 0, ir_usage_address_taken = 1 << 0, ir_usage_write = 1 << 1, ir_usage_read = 1 << 2,
  ir_usage_reinterpret_cast = 1 << 3, ir_usage_unknown
}
 Bitfield type indicating the way an entity is used. More...
 

Functions

ir_visibility get_entity_visibility (const ir_entity *entity)
 Returns the visibility class of an entity. More...
 
void set_entity_visibility (ir_entity *entity, ir_visibility visibility)
 Sets visibility class of an entity. More...
 
int entity_is_externally_visible (const ir_entity *entity)
 Returns 1 if the entity is visible outside the current compilation unit or to unknown callers (like asm statements). More...
 
int entity_has_definition (const ir_entity *entity)
 Returns 1 if the entity has a definition (initializer) in the current compilation unit. More...
 
ir_entitynew_entity (ir_type *owner, ident *name, ir_type *tp)
 Creates a new entity. More...
 
ir_entitynew_global_entity (ir_type *segment, ident *ld_name, ir_type *type, ir_visibility visibility, ir_linkage linkage)
 Creates a new global entity. More...
 
ir_entitynew_parameter_entity (ir_type *owner, size_t pos, ir_type *type)
 Creates a new entity corresponding to a function parameter. More...
 
ir_entitynew_alias_entity (ir_type *owner, ident *name, ir_entity *alias, ir_type *type, ir_visibility visibility)
 Creates a new entity aliasing another entity. More...
 
void set_entity_alias (ir_entity *alias, ir_entity *aliased)
 Sets the entity an alias entity aliases. More...
 
ir_entityget_entity_alias (const ir_entity *alias)
 Returns the entity aliased by an alias entity. More...
 
int check_entity (const ir_entity *ent)
 Check an entity. More...
 
ir_entitycopy_entity_own (ir_entity *old, ir_type *new_owner)
 Copies the entity if the new_owner is different from the owner of the old entity, else returns the old entity. More...
 
ir_entitycopy_entity_name (ir_entity *old, ident *new_name)
 Copies the entity if the new_name is different from the name of the old entity, else returns the old entity. More...
 
void free_entity (ir_entity *ent)
 Frees the entity. More...
 
const char * get_entity_name (const ir_entity *ent)
 Returns the name of an entity. More...
 
identget_entity_ident (const ir_entity *ent)
 Returns the ident of an entity. More...
 
void set_entity_ident (ir_entity *ent, ident *id)
 Sets the ident of the entity. More...
 
identget_entity_ld_ident (const ir_entity *ent)
 Returns the mangled name of the entity. More...
 
void set_entity_ld_ident (ir_entity *ent, ident *ld_ident)
 Sets the mangled name of the entity. More...
 
const char * get_entity_ld_name (const ir_entity *ent)
 Returns the mangled name of the entity as a string. More...
 
int entity_has_ld_ident (const ir_entity *entity)
 returns 1 if the entity has an ld_ident set explicitely More...
 
ir_typeget_entity_owner (const ir_entity *ent)
 Returns the owner of the entity. More...
 
void set_entity_owner (ir_entity *ent, ir_type *owner)
 Sets the owner field in entity to owner. More...
 
ir_typeget_entity_type (const ir_entity *ent)
 Returns the type of an entity. More...
 
void set_entity_type (ir_entity *ent, ir_type *tp)
 Sets the type of an entity. More...
 
ir_linkage get_entity_linkage (const ir_entity *entity)
 Returns the linkage of an entity. More...
 
void set_entity_linkage (ir_entity *entity, ir_linkage linkage)
 Sets the linkage flags of entity entity to linkage. More...
 
void add_entity_linkage (ir_entity *entity, ir_linkage linkage)
 Adds linkage flags linkage to entity entity. More...
 
void remove_entity_linkage (ir_entity *entity, ir_linkage linkage)
 Remove linkage flags linkage from entity entity. More...
 
ir_volatility get_entity_volatility (const ir_entity *ent)
 Returns the volatility of an entity. More...
 
void set_entity_volatility (ir_entity *ent, ir_volatility vol)
 Sets the volatility of an entity. More...
 
const char * get_volatility_name (ir_volatility var)
 Returns the name of the volatility. More...
 
unsigned get_entity_alignment (const ir_entity *entity)
 Returns alignment of entity in bytes. More...
 
void set_entity_alignment (ir_entity *entity, unsigned alignment)
 Allows you to override the type alignment for an entity. More...
 
ir_align get_entity_aligned (const ir_entity *ent)
 Returns indication whether entity is aligned in memory. More...
 
void set_entity_aligned (ir_entity *ent, ir_align a)
 Sets indication whether entity is aligned in memory. More...
 
const char * get_align_name (ir_align a)
 Returns the name of the alignment. More...
 
int get_entity_offset (const ir_entity *entity)
 Returns the offset of an entity (in a compound) in bytes. More...
 
void set_entity_offset (ir_entity *entity, int offset)
 Sets the offset of an entity (in a compound) in bytes. More...
 
unsigned get_entity_bitfield_offset (const ir_entity *entity)
 For bitfields, returns the offset in bits to the bitfield base. More...
 
void set_entity_bitfield_offset (ir_entity *entity, unsigned offset)
 Sets the offset in bits to the base for a bitfield. More...
 
void set_entity_bitfield_size (ir_entity *entity, unsigned size)
 Sets the size in bits for a bitfield. More...
 
unsigned get_entity_bitfield_size (const ir_entity *entity)
 Returns the size in bits for a bitfield, 0 if entity is not a bitfield. More...
 
void * get_entity_link (const ir_entity *ent)
 Returns the stored intermediate information. More...
 
void set_entity_link (ir_entity *ent, void *l)
 Stores new intermediate information. More...
 
ir_graphget_entity_irg (const ir_entity *ent)
 Return the method graph of a method entity. More...
 
ir_graphget_entity_linktime_irg (const ir_entity *ent)
 Return the method graph the method entity points to after linking. More...
 
unsigned get_entity_vtable_number (const ir_entity *ent)
 Returns the entity vtable number. More...
 
void set_entity_vtable_number (ir_entity *ent, unsigned vtable_number)
 Sets the entity vtable number. More...
 
void set_entity_label (ir_entity *ent, ir_label_t label)
 Sets label number of an entity with code type. More...
 
ir_label_t get_entity_label (const ir_entity *ent)
 Returns label number of an entity with code type. More...
 
ir_entity_usage get_entity_usage (const ir_entity *ent)
 Returns the entity usage. More...
 
void set_entity_usage (ir_entity *ent, ir_entity_usage flag)
 Sets/resets the state of the address taken flag of an entity. More...
 
dbg_infoget_entity_dbg_info (const ir_entity *ent)
 Returns the debug information of an entity. More...
 
void set_entity_dbg_info (ir_entity *ent, dbg_info *db)
 Sets the debug information of an entity. More...
 
int is_parameter_entity (const ir_entity *entity)
 returns true if a given entity is a parameter_entity representing the address of a function parameter More...
 
size_t get_entity_parameter_number (const ir_entity *entity)
 returns number of parameter a parameter entitiy represents More...
 
void set_entity_parameter_number (ir_entity *entity, size_t n)
 set number of parameter an entity represents More...
 
ir_nodeget_atomic_ent_value (const ir_entity *ent)
 Returns initial value of entity with atomic type ent. More...
 
void set_atomic_ent_value (ir_entity *ent, ir_node *val)
 Sets initial value of entity with atomic type ent to node val. More...
 
void set_entity_initializer (ir_entity *entity, ir_initializer_t *initializer)
 Sets the new style initializers of an entity. More...
 
ir_initializer_tget_entity_initializer (const ir_entity *entity)
 Returns the new style initializers of an entity. More...
 
void add_entity_overwrites (ir_entity *ent, ir_entity *overwritten)
 Adds entity ent to the list of entities that overwrite overwritten. More...
 
size_t get_entity_n_overwrites (const ir_entity *ent)
 Returns the number of entities in the list of entities that overwrite entity ent. More...
 
size_t get_entity_overwrites_index (const ir_entity *ent, ir_entity *overwritten)
 Returns index of overwritten in list of entities overwriting entity ent. More...
 
ir_entityget_entity_overwrites (const ir_entity *ent, size_t pos)
 Returns entry pos in list of entities overwriting entity ent. More...
 
void set_entity_overwrites (ir_entity *ent, size_t pos, ir_entity *overwritten)
 Sets entry pos in list of entities overwriting entity ent. More...
 
void remove_entity_overwrites (ir_entity *ent, ir_entity *overwritten)
 Remove overwritten from list of entities overwriting entity ent. More...
 
size_t get_entity_n_overwrittenby (const ir_entity *ent)
 Returns number of entities overwritten by ent. More...
 
size_t get_entity_overwrittenby_index (const ir_entity *ent, ir_entity *overwrites)
 Returns index of overwrites in list of entities overwritten by entity ent. More...
 
ir_entityget_entity_overwrittenby (const ir_entity *ent, size_t pos)
 Return entry pos in list of entities overwritten by entity ent. More...
 
void set_entity_overwrittenby (ir_entity *ent, size_t pos, ir_entity *overwrites)
 Sets entry pos in list of entities overwritten by entity ent. More...
 
void remove_entity_overwrittenby (ir_entity *ent, ir_entity *overwrites)
 Removes entry overwrites in list of entities overwritten by ent. More...
 
int is_atomic_entity (const ir_entity *ent)
 Returns true if the type of the entity is a primitive, pointer or method type. More...
 
int is_compound_entity (const ir_entity *ent)
 Returns true if the type of the entity is a class, structure, array or union type. More...
 
int is_method_entity (const ir_entity *ent)
 Returns true if the entity is a method entity. More...
 
int is_alias_entity (const ir_entity *ent)
 Returns true if the entity is an alias entity. More...
 
long get_entity_nr (const ir_entity *ent)
 Outputs a unique number for this entity if libfirm is compiled for debugging, (configure with –enable-debug) else returns the address of the type cast to long. More...
 
ir_visited_t get_entity_visited (const ir_entity *ent)
 Returns the entities visited counter. More...
 
void set_entity_visited (ir_entity *ent, ir_visited_t num)
 Sets the entities visited counter. More...
 
void mark_entity_visited (ir_entity *ent)
 Marks entity as visited. More...
 
int entity_visited (const ir_entity *ent)
 Returns true if this entity was visited. More...
 
int entity_not_visited (const ir_entity *ent)
 Returns true if this entity was not visited. More...
 
int entity_has_additional_properties (const ir_entity *entity)
 Return true if this entity can be queried for additional properties. More...
 
mtp_additional_properties get_entity_additional_properties (const ir_entity *ent)
 Returns the mask of the additional entity properties. More...
 
void set_entity_additional_properties (ir_entity *ent, mtp_additional_properties prop)
 Sets the mask of the additional graph properties. More...
 
void add_entity_additional_properties (ir_entity *ent, mtp_additional_properties flag)
 Sets additional graph properties. More...
 
ir_entityget_unknown_entity (void)
 Returns the unknown entity . More...
 
int is_unknown_entity (const ir_entity *entity)
 Tests whether entity entity is (the) unknown entity. More...
 

Detailed Description

An entity is the representation of program known objects in Firm.

The primary concept of entities is to represent members of complex types, i.e., fields and methods of classes. As not all programming language model all variables and methods as members of some class, the concept of entities is extended to cover also local and global variables, and arbitrary procedures.

An entity always specifies the type of the object it represents and the type of the object it is a part of, the owner of the entity. Originally this is the type of the class of which the entity is a member. The owner of local variables is the procedure they are defined in. The owner of global variables and procedures visible in the whole program is a universally defined class type "GlobalType". The owner of procedures defined in the scope of an other procedure is the enclosing procedure.

The type ir_entity is an abstract data type to represent program entities. If contains the following attributes:

These fields can only be accessed via access functions.

Overwrites is a field that specifies that an access to the overwritten entity in the supertype must use this entity. It's a list as with multiple inheritance several entities can be overwritten. This field is mostly useful for method entities. If a Sel node selects an entity that is overwritten by other entities it must return a pointer to the entity of the dynamic type of the pointer that is passed to it. Lowering of the Sel node must assure this. Overwrittenby is the inverse of overwrites. Both add routines add both relations, they only differ in the order of arguments.

The Unknown entity

This entity is an auxiliary entity dedicated to support analyses.The unknown entity represents that there could be an entity, but it is not known. This entity can be used to initialize fields before an analysis (not known yet) or to represent the top of a lattice (could not be determined). There exists exactly one entity unknown. This entity has as owner and as type the unknown type. It is allocated when initializing the entity module.The entity can take the role of any entity, also methods. It returns default values in these cases.The following values are set:
  • name = "unknown_entity"
  • ld_name = "unknown_entity"
  • owner = unknown_type
  • type = unknown_type
  • offset = -1
  • value = Address(unknown_entity)
  • values = NULL
  • val_paths = NULL
  • volatility = volatility_non_volatile
  • stickyness = stickyness_unsticky
  • ld_name = NULL
  • overwrites = NULL
  • overwrittenby = NULL
  • irg = NULL
  • link = NULL

Macro Definition Documentation

#define IR_VA_START_PARAMETER_NUMBER   ((size_t)-1)

Sepcial parameter number which can be used for parameter entities to indicate the first non-declared parameter in a procedure with variable arguments.

We assumes that all additional parameters for variable parameters are on the stack. Starting from this address you can walk the stack to find all other parameters.

Definition at line 480 of file typerep.h.

#define IR_VTABLE_NUM_NOT_SET   ((unsigned)(-1))

A reserved value for "not yet set".

Definition at line 422 of file typerep.h.

Typedef Documentation

typedef struct ir_entity ir_entity

Entity.

Definition at line 83 of file firm_types.h.

Enumeration Type Documentation

Bitfield type indicating the way an entity is used.

Enumerator
ir_usage_none 

This entity is unused.

ir_usage_address_taken 

The address of this entity was taken.

ir_usage_write 

The entity was written to.

ir_usage_read 

The entity was read.

ir_usage_reinterpret_cast 

The entity was read but with a wrong mode (an implicit reinterpret cast)

ir_usage_unknown 

Unknown access.

Definition at line 438 of file typerep.h.

enum ir_linkage

linkage specifies how the linker treats symbols

Enumerator
IR_LINKAGE_DEFAULT 
IR_LINKAGE_CONSTANT 

A symbol whose definition won't change in a program.

Optimization might replace loads from this entity with constants. Also most linkers put such data in a constant segment which is shared between multiple running instances of the same application.

IR_LINKAGE_WEAK 

The entity is a weak symbol.

A weak symbol is overridden by a non-weak symbol if one exists. Most linkers only support the IR_LINKAGE_WEAK in combination with IR_LINKAGE_MERGE.

IR_LINKAGE_GARBAGE_COLLECT 

The entity may be removed when it isn't referenced anywhere in the compilation unit even if it is exported (non-local).

Typically used for C++ instantiated template code (,,COMDAT'' section).

IR_LINKAGE_MERGE 

The linker will try to merge entities with same name from different compilation units.

This is the usual behaviour for global variables without explicit initialisation in C (``COMMON'' symbols). It's also typically used in C++ for instantiated template code (,,COMDAT'' section)

IR_LINKAGE_HIDDEN_USER 

Some entity uses are potentially hidden from the compiler.

(For example because they happen in an asm("") statement. This flag should be set for attribute((used)) in C code). Setting this flag prohibits that the compiler making assumptions about read/write behaviour to global variables or changing calling conventions from cdecl to fastcall.

IR_LINKAGE_NO_CODEGEN 

Do not generate code even if the entity has a graph attached.

The graph is only used for inlining. Otherwise the entity is regarded as a declaration of an externally defined entity. This linkage flag can be used to implement C99 "inline" or GNU89 "extern inline".

IR_LINKAGE_NO_IDENTITY 

The entity does not need to have an address that is different from other entities.

When this property is set the entity may be safely merged with entities with the same content.

Definition at line 119 of file typerep.h.

Visibility classed for entities.

Enumerator
ir_visibility_external 

The entity is visible across compilation units.

It might have an initializer/graph. Note that entities with visibility_external without initializer are assumed to be defined in another compilation unit (not like C variables which are considered 'uninitialized' in this case).

ir_visibility_external_private 

The entity is visible across compilation units, but not across modules.

This is equivalent to attribute((visibility("hidden"))) in gcc.

ir_visibility_external_protected 

The entity is visible across compilation units and modules and cannot be overridden by other modules.

Equivalent to attribute((visible("protected"))) in gcc.

ir_visibility_local 

The entity is local to the compilation unit.

A local entity is not visible in other compilation units. Note that the entity might still be accessed indirectly from other units through pointers.

ir_visibility_private 

This has the same semantic as visibility_local.

Additionally the symbol is completely hidden from the linker (it only appears in the assembly). While visibility_local is probably still visible to debuggers, visibility_private symbols aren't and probably won't appear in the object files

Definition at line 79 of file typerep.h.

Function Documentation

void add_entity_additional_properties ( ir_entity ent,
mtp_additional_properties  flag 
)

Sets additional graph properties.

void add_entity_linkage ( ir_entity entity,
ir_linkage  linkage 
)

Adds linkage flags linkage to entity entity.

void add_entity_overwrites ( ir_entity ent,
ir_entity overwritten 
)

Adds entity ent to the list of entities that overwrite overwritten.

int check_entity ( const ir_entity ent)

Check an entity.

Returns
non-zero if no errors were found
ir_entity* copy_entity_name ( ir_entity old,
ident new_name 
)

Copies the entity if the new_name is different from the name of the old entity, else returns the old entity.

Automatically inserts the new entity as a member of owner. The mangled name ld_name is set to NULL. Overwrites relation is copied from old.

ir_entity* copy_entity_own ( ir_entity old,
ir_type new_owner 
)

Copies the entity if the new_owner is different from the owner of the old entity, else returns the old entity.

Automatically inserts the new entity as a member of owner. Resets the overwrites/overwritten_by fields. Keeps the old atomic value.

int entity_has_additional_properties ( const ir_entity entity)

Return true if this entity can be queried for additional properties.

This is possible for method and alias entities.

int entity_has_definition ( const ir_entity entity)

Returns 1 if the entity has a definition (initializer) in the current compilation unit.

Note that this function returns false if IR_LINKAGE_NO_CODEGEN is set even if a graph is present.

int entity_has_ld_ident ( const ir_entity entity)

returns 1 if the entity has an ld_ident set explicitely

int entity_is_externally_visible ( const ir_entity entity)

Returns 1 if the entity is visible outside the current compilation unit or to unknown callers (like asm statements).

(The entity might still be accessible indirectly through pointers) This is a convenience function and does the same as get_entity_visibility(entity) != ir_visibility_local || (get_entity_linkage(entity) & IR_LINKAGE_HIDDEN_USER)

int entity_not_visited ( const ir_entity ent)

Returns true if this entity was not visited.

See Also
Visited Counters
int entity_visited ( const ir_entity ent)

Returns true if this entity was visited.

See Also
Visited Counters
void free_entity ( ir_entity ent)

Frees the entity.

The owner will still contain the pointer to this entity, as well as all other references!

const char* get_align_name ( ir_align  a)

Returns the name of the alignment.

ir_node* get_atomic_ent_value ( const ir_entity ent)

Returns initial value of entity with atomic type ent.

mtp_additional_properties get_entity_additional_properties ( const ir_entity ent)

Returns the mask of the additional entity properties.

The properties are automatically inherited from the irg if available or from the method type if they were not set using set_entity_additional_properties() or set_entity_additional_property().

ir_entity* get_entity_alias ( const ir_entity alias)

Returns the entity aliased by an alias entity.

ir_align get_entity_aligned ( const ir_entity ent)

Returns indication whether entity is aligned in memory.

unsigned get_entity_alignment ( const ir_entity entity)

Returns alignment of entity in bytes.

unsigned get_entity_bitfield_offset ( const ir_entity entity)

For bitfields, returns the offset in bits to the bitfield base.

unsigned get_entity_bitfield_size ( const ir_entity entity)

Returns the size in bits for a bitfield, 0 if entity is not a bitfield.

dbg_info* get_entity_dbg_info ( const ir_entity ent)

Returns the debug information of an entity.

Parameters
entThe entity.
ident* get_entity_ident ( const ir_entity ent)

Returns the ident of an entity.

ir_initializer_t* get_entity_initializer ( const ir_entity entity)

Returns the new style initializers of an entity.

ir_graph* get_entity_irg ( const ir_entity ent)

Return the method graph of a method entity.

Warning
If it is a weak symbol, then this is not necessarily the final code bound to the entity. If you are writing an analysis use get_entity_linktime_irg()!
ir_label_t get_entity_label ( const ir_entity ent)

Returns label number of an entity with code type.

ident* get_entity_ld_ident ( const ir_entity ent)

Returns the mangled name of the entity.

If the mangled name is set it returns the existing name. Else it generates a name with mangle_entity() and remembers this new name internally.

const char* get_entity_ld_name ( const ir_entity ent)

Returns the mangled name of the entity as a string.

void* get_entity_link ( const ir_entity ent)

Returns the stored intermediate information.

ir_linkage get_entity_linkage ( const ir_entity entity)

Returns the linkage of an entity.

ir_graph* get_entity_linktime_irg ( const ir_entity ent)

Return the method graph the method entity points to after linking.

This is different to get_entity_irg() in case of weak symbols where this function returns NULL because the code may be replaced by a non-weak symbol after linking.

size_t get_entity_n_overwrites ( const ir_entity ent)

Returns the number of entities in the list of entities that overwrite entity ent.

size_t get_entity_n_overwrittenby ( const ir_entity ent)

Returns number of entities overwritten by ent.

const char* get_entity_name ( const ir_entity ent)

Returns the name of an entity.

long get_entity_nr ( const ir_entity ent)

Outputs a unique number for this entity if libfirm is compiled for debugging, (configure with –enable-debug) else returns the address of the type cast to long.

int get_entity_offset ( const ir_entity entity)

Returns the offset of an entity (in a compound) in bytes.

Only set if layout = fixed.

ir_entity* get_entity_overwrites ( const ir_entity ent,
size_t  pos 
)

Returns entry pos in list of entities overwriting entity ent.

size_t get_entity_overwrites_index ( const ir_entity ent,
ir_entity overwritten 
)

Returns index of overwritten in list of entities overwriting entity ent.

ir_entity* get_entity_overwrittenby ( const ir_entity ent,
size_t  pos 
)

Return entry pos in list of entities overwritten by entity ent.

size_t get_entity_overwrittenby_index ( const ir_entity ent,
ir_entity overwrites 
)

Returns index of overwrites in list of entities overwritten by entity ent.

ir_type* get_entity_owner ( const ir_entity ent)

Returns the owner of the entity.

size_t get_entity_parameter_number ( const ir_entity entity)

returns number of parameter a parameter entitiy represents

ir_type* get_entity_type ( const ir_entity ent)

Returns the type of an entity.

ir_entity_usage get_entity_usage ( const ir_entity ent)

Returns the entity usage.

ir_visibility get_entity_visibility ( const ir_entity entity)

Returns the visibility class of an entity.

ir_visited_t get_entity_visited ( const ir_entity ent)

Returns the entities visited counter.

See Also
Visited Counters
ir_volatility get_entity_volatility ( const ir_entity ent)

Returns the volatility of an entity.

unsigned get_entity_vtable_number ( const ir_entity ent)

Returns the entity vtable number.

ir_entity* get_unknown_entity ( void  )

Returns the unknown entity .

const char* get_volatility_name ( ir_volatility  var)

Returns the name of the volatility.

int is_alias_entity ( const ir_entity ent)

Returns true if the entity is an alias entity.

int is_atomic_entity ( const ir_entity ent)

Returns true if the type of the entity is a primitive, pointer or method type.

Note
This is a different classification than from is_primitive_type().
int is_compound_entity ( const ir_entity ent)

Returns true if the type of the entity is a class, structure, array or union type.

int is_method_entity ( const ir_entity ent)

Returns true if the entity is a method entity.

int is_parameter_entity ( const ir_entity entity)

returns true if a given entity is a parameter_entity representing the address of a function parameter

int is_unknown_entity ( const ir_entity entity)

Tests whether entity entity is (the) unknown entity.

Returns
1 if it is the unknown entity, 0 otherwise
void mark_entity_visited ( ir_entity ent)

Marks entity as visited.

See Also
Visited Counters
ir_entity* new_alias_entity ( ir_type owner,
ident name,
ir_entity alias,
ir_type type,
ir_visibility  visibility 
)

Creates a new entity aliasing another entity.

An aliasing entity is a logically separate entity with its own name, but instead of having a definition the linker will merge the name with the definition of the aliased entity. In gcc this feature is known as attribute((alias())).

Parameters
ownerowning type (must be a global segment)
namename of the entity
aliasentity that is aliased
typetype of the aliased entity, should but need not be the same type as the one of the aliased entity
visibilityvisibility of the entity
Returns
the newly created entity
ir_entity* new_entity ( ir_type owner,
ident name,
ir_type tp 
)

Creates a new entity.

Automatically inserts the entity as a member of owner. Entity is automatic_allocated and uninitialized except if the type is type_method, then it is static_allocated and constant. Visibility is local, offset -1, and it is not volatile.

ir_entity* new_global_entity ( ir_type segment,
ident ld_name,
ir_type type,
ir_visibility  visibility,
ir_linkage  linkage 
)

Creates a new global entity.

ir_entity* new_parameter_entity ( ir_type owner,
size_t  pos,
ir_type type 
)

Creates a new entity corresponding to a function parameter.

This must be created on an irgs frame_type

void remove_entity_linkage ( ir_entity entity,
ir_linkage  linkage 
)

Remove linkage flags linkage from entity entity.

void remove_entity_overwrites ( ir_entity ent,
ir_entity overwritten 
)

Remove overwritten from list of entities overwriting entity ent.

void remove_entity_overwrittenby ( ir_entity ent,
ir_entity overwrites 
)

Removes entry overwrites in list of entities overwritten by ent.

void set_atomic_ent_value ( ir_entity ent,
ir_node val 
)

Sets initial value of entity with atomic type ent to node val.

Note
val must be a node in the const_code graph
void set_entity_additional_properties ( ir_entity ent,
mtp_additional_properties  prop 
)

Sets the mask of the additional graph properties.

void set_entity_alias ( ir_entity alias,
ir_entity aliased 
)

Sets the entity an alias entity aliases.

void set_entity_aligned ( ir_entity ent,
ir_align  a 
)

Sets indication whether entity is aligned in memory.

void set_entity_alignment ( ir_entity entity,
unsigned  alignment 
)

Allows you to override the type alignment for an entity.

Parameters
entitythe entity
alignmentalignment in bytes
void set_entity_bitfield_offset ( ir_entity entity,
unsigned  offset 
)

Sets the offset in bits to the base for a bitfield.

void set_entity_bitfield_size ( ir_entity entity,
unsigned  size 
)

Sets the size in bits for a bitfield.

0 means not a bitfield.

void set_entity_dbg_info ( ir_entity ent,
dbg_info db 
)

Sets the debug information of an entity.

Parameters
entThe entity.
dbThe debug info.
void set_entity_ident ( ir_entity ent,
ident id 
)

Sets the ident of the entity.

void set_entity_initializer ( ir_entity entity,
ir_initializer_t initializer 
)

Sets the new style initializers of an entity.

void set_entity_label ( ir_entity ent,
ir_label_t  label 
)

Sets label number of an entity with code type.

void set_entity_ld_ident ( ir_entity ent,
ident ld_ident 
)

Sets the mangled name of the entity.

void set_entity_link ( ir_entity ent,
void *  l 
)

Stores new intermediate information.

void set_entity_linkage ( ir_entity entity,
ir_linkage  linkage 
)

Sets the linkage flags of entity entity to linkage.

void set_entity_offset ( ir_entity entity,
int  offset 
)

Sets the offset of an entity (in a compound) in bytes.

void set_entity_overwrites ( ir_entity ent,
size_t  pos,
ir_entity overwritten 
)

Sets entry pos in list of entities overwriting entity ent.

void set_entity_overwrittenby ( ir_entity ent,
size_t  pos,
ir_entity overwrites 
)

Sets entry pos in list of entities overwritten by entity ent.

void set_entity_owner ( ir_entity ent,
ir_type owner 
)

Sets the owner field in entity to owner.

Automatically removes entity from old owner type and adds it to the new one.

void set_entity_parameter_number ( ir_entity entity,
size_t  n 
)

set number of parameter an entity represents

void set_entity_type ( ir_entity ent,
ir_type tp 
)

Sets the type of an entity.

void set_entity_usage ( ir_entity ent,
ir_entity_usage  flag 
)

Sets/resets the state of the address taken flag of an entity.

void set_entity_visibility ( ir_entity entity,
ir_visibility  visibility 
)

Sets visibility class of an entity.

void set_entity_visited ( ir_entity ent,
ir_visited_t  num 
)

Sets the entities visited counter.

See Also
Visited Counters
void set_entity_volatility ( ir_entity ent,
ir_volatility  vol 
)

Sets the volatility of an entity.

void set_entity_vtable_number ( ir_entity ent,
unsigned  vtable_number 
)

Sets the entity vtable number.