libFirm
Entities

An entity is the Firm representation of an object known to the program. 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 classes 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 aliased entity of an alias entity. 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_entityclone_entity (ir_entity const *old, ident *name, ir_type *owner)
 Create a new entity with attributes copied from an existing 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 the parameter number of the parameter which entity represents. More...
 
void set_entity_parameter_number (ir_entity *entity, size_t n)
 Sets the parameter number of the parameter which entity represents. More...
 
void set_entity_initializer (ir_entity *entity, ir_initializer_t *initializer)
 Sets the initializer of an entity. More...
 
ir_initializer_tget_entity_initializer (const ir_entity *entity)
 Returns the initializer 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_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. 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 Firm representation of an object known to the program.

The primary concept of entities is to represent members of complex types, i.e., fields and methods of classes. As not all programming languages 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. It 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_entity_overwrites() and add_entity_overwrittenby() update both lists, 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 unknown entity. This entity has as type the unknown type and its owner is the dummy type. It is allocated when initializing the entity module.

Macro Definition Documentation

◆ IR_VA_START_PARAMETER_NUMBER

#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.

Starting from this address you can walk the stack to find further parameters.

Definition at line 473 of file typerep.h.

◆ IR_VTABLE_NUM_NOT_SET

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

A reserved value for "not yet set".

Definition at line 416 of file typerep.h.

Typedef Documentation

◆ ir_entity

typedef struct ir_entity ir_entity

Entity.

Definition at line 83 of file firm_types.h.

Enumeration Type Documentation

◆ ir_entity_usage

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 432 of file typerep.h.

◆ ir_linkage

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 or initialization data attached.

The graph/data 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.

◆ ir_visibility

Visibility classes 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

◆ add_entity_additional_properties()

void add_entity_additional_properties ( ir_entity ent,
mtp_additional_properties  flag 
)

Sets additional graph properties.

◆ add_entity_linkage()

void add_entity_linkage ( ir_entity entity,
ir_linkage  linkage 
)

Adds linkage flags linkage to entity entity.

◆ add_entity_overwrites()

void add_entity_overwrites ( ir_entity ent,
ir_entity overwritten 
)

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

◆ check_entity()

int check_entity ( const ir_entity ent)

Check an entity.

Returns
non-zero if no errors were found

◆ clone_entity()

ir_entity* clone_entity ( ir_entity const *  old,
ident name,
ir_type owner 
)

Create a new entity with attributes copied from an existing entity.

Does not copy the overwrites, overwritten_by, visited and usage fields, sets a new name and inserts the entity into owner.

◆ entity_has_additional_properties()

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.

◆ entity_has_definition()

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.

◆ entity_has_ld_ident()

int entity_has_ld_ident ( const ir_entity entity)

returns 1 if the entity has an ld_ident set explicitely

◆ entity_is_externally_visible()

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).

If invisible, 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)

◆ entity_not_visited()

int entity_not_visited ( const ir_entity ent)

Returns true if this entity was not visited.

See also
Visited Counters

◆ entity_visited()

int entity_visited ( const ir_entity ent)

Returns true if this entity was visited.

See also
Visited Counters

◆ free_entity()

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!

◆ get_align_name()

const char* get_align_name ( ir_align  a)

Returns the name of the alignment.

◆ get_entity_additional_properties()

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().

◆ get_entity_alias()

ir_entity* get_entity_alias ( const ir_entity alias)

Returns the entity aliased by an alias entity.

◆ get_entity_aligned()

ir_align get_entity_aligned ( const ir_entity ent)

Returns indication whether entity is aligned in memory.

◆ get_entity_alignment()

unsigned get_entity_alignment ( const ir_entity entity)

Returns alignment of entity in bytes.

◆ get_entity_bitfield_offset()

unsigned get_entity_bitfield_offset ( const ir_entity entity)

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

◆ get_entity_bitfield_size()

unsigned get_entity_bitfield_size ( const ir_entity entity)

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

◆ get_entity_dbg_info()

dbg_info* get_entity_dbg_info ( const ir_entity ent)

Returns the debug information of an entity.

Parameters
entThe entity.

◆ get_entity_ident()

ident* get_entity_ident ( const ir_entity ent)

Returns the ident of an entity.

◆ get_entity_initializer()

ir_initializer_t* get_entity_initializer ( const ir_entity entity)

Returns the initializer of an entity.

◆ get_entity_irg()

ir_graph* get_entity_irg ( const ir_entity ent)

Return the method graph of a method entity.

Warning
If the entity has IR_LINKAGE_WEAK, then this is not necessarily the final code bound to the entity. If you are writing an analysis use get_entity_linktime_irg()!

◆ get_entity_label()

ir_label_t get_entity_label ( const ir_entity ent)

Returns label number of an entity with code type.

◆ get_entity_ld_ident()

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.

◆ get_entity_ld_name()

const char* get_entity_ld_name ( const ir_entity ent)

Returns the mangled name of the entity as a string.

◆ get_entity_link()

void* get_entity_link ( const ir_entity ent)

Returns the stored intermediate information.

◆ get_entity_linkage()

ir_linkage get_entity_linkage ( const ir_entity entity)

Returns the linkage of an entity.

◆ get_entity_linktime_irg()

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.

◆ get_entity_n_overwrites()

size_t get_entity_n_overwrites ( const ir_entity ent)

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

◆ get_entity_n_overwrittenby()

size_t get_entity_n_overwrittenby ( const ir_entity ent)

Returns number of entities overwritten by ent.

◆ get_entity_name()

const char* get_entity_name ( const ir_entity ent)

Returns the name of an entity.

◆ get_entity_nr()

long get_entity_nr ( const ir_entity ent)

Outputs a unique number for this entity.

◆ get_entity_offset()

int get_entity_offset ( const ir_entity entity)

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

Only set if the layout of the entity's owner has been fixed.

See also
get_type_state()

◆ get_entity_overwrites()

ir_entity* get_entity_overwrites ( const ir_entity ent,
size_t  pos 
)

Returns entry pos in list of entities overwriting entity ent.

◆ get_entity_overwrites_index()

size_t get_entity_overwrites_index ( const ir_entity ent,
ir_entity overwritten 
)

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

◆ get_entity_overwrittenby()

ir_entity* get_entity_overwrittenby ( const ir_entity ent,
size_t  pos 
)

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

◆ get_entity_overwrittenby_index()

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.

◆ get_entity_owner()

ir_type* get_entity_owner ( const ir_entity ent)

Returns the owner of the entity.

◆ get_entity_parameter_number()

size_t get_entity_parameter_number ( const ir_entity entity)

Returns the parameter number of the parameter which entity represents.

◆ get_entity_type()

ir_type* get_entity_type ( const ir_entity ent)

Returns the type of an entity.

◆ get_entity_usage()

ir_entity_usage get_entity_usage ( const ir_entity ent)

Returns the entity usage.

◆ get_entity_visibility()

ir_visibility get_entity_visibility ( const ir_entity entity)

Returns the visibility class of an entity.

◆ get_entity_visited()

ir_visited_t get_entity_visited ( const ir_entity ent)

Returns the entities visited counter.

See also
Visited Counters

◆ get_entity_volatility()

ir_volatility get_entity_volatility ( const ir_entity ent)

Returns the volatility of an entity.

◆ get_entity_vtable_number()

unsigned get_entity_vtable_number ( const ir_entity ent)

Returns the entity vtable number.

◆ get_unknown_entity()

ir_entity* get_unknown_entity ( void  )

Returns the unknown entity .

◆ get_volatility_name()

const char* get_volatility_name ( ir_volatility  var)

Returns the name of the volatility.

◆ is_alias_entity()

int is_alias_entity ( const ir_entity ent)

Returns true if the entity is an alias entity.

◆ is_compound_entity()

int is_compound_entity ( const ir_entity ent)

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

◆ is_method_entity()

int is_method_entity ( const ir_entity ent)

Returns true if the entity is a method entity.

◆ is_parameter_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

◆ is_unknown_entity()

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

◆ mark_entity_visited()

void mark_entity_visited ( ir_entity ent)

Marks entity as visited.

See also
Visited Counters

◆ new_alias_entity()

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 aliasing 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

◆ new_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 external, offset -1, and it is not volatile.

◆ new_global_entity()

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.

◆ new_parameter_entity()

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

Creates a new entity corresponding to a function parameter.

The owner must be an ir_graph's frame_type.

See also
get_irg_frame_type()

◆ remove_entity_linkage()

void remove_entity_linkage ( ir_entity entity,
ir_linkage  linkage 
)

Remove linkage flags linkage from entity entity.

◆ remove_entity_overwrites()

void remove_entity_overwrites ( ir_entity ent,
ir_entity overwritten 
)

Remove overwritten from list of entities overwriting entity ent.

◆ remove_entity_overwrittenby()

void remove_entity_overwrittenby ( ir_entity ent,
ir_entity overwrites 
)

Removes entry overwrites in list of entities overwritten by ent.

◆ set_entity_additional_properties()

void set_entity_additional_properties ( ir_entity ent,
mtp_additional_properties  prop 
)

Sets the mask of the additional graph properties.

◆ set_entity_alias()

void set_entity_alias ( ir_entity alias,
ir_entity aliased 
)

Sets the aliased entity of an alias entity.

◆ set_entity_aligned()

void set_entity_aligned ( ir_entity ent,
ir_align  a 
)

Sets indication whether entity is aligned in memory.

◆ set_entity_alignment()

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

◆ set_entity_bitfield_offset()

void set_entity_bitfield_offset ( ir_entity entity,
unsigned  offset 
)

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

◆ set_entity_bitfield_size()

void set_entity_bitfield_size ( ir_entity entity,
unsigned  size 
)

Sets the size in bits for a bitfield.

0 means not a bitfield.

◆ set_entity_dbg_info()

void set_entity_dbg_info ( ir_entity ent,
dbg_info db 
)

Sets the debug information of an entity.

Parameters
entThe entity.
dbThe debug info.

◆ set_entity_ident()

void set_entity_ident ( ir_entity ent,
ident id 
)

Sets the ident of the entity.

◆ set_entity_initializer()

void set_entity_initializer ( ir_entity entity,
ir_initializer_t initializer 
)

Sets the initializer of an entity.

◆ set_entity_label()

void set_entity_label ( ir_entity ent,
ir_label_t  label 
)

Sets label number of an entity with code type.

◆ set_entity_ld_ident()

void set_entity_ld_ident ( ir_entity ent,
ident ld_ident 
)

Sets the mangled name of the entity.

◆ set_entity_link()

void set_entity_link ( ir_entity ent,
void *  l 
)

Stores new intermediate information.

◆ set_entity_linkage()

void set_entity_linkage ( ir_entity entity,
ir_linkage  linkage 
)

Sets the linkage flags of entity entity to linkage.

◆ set_entity_offset()

void set_entity_offset ( ir_entity entity,
int  offset 
)

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

◆ set_entity_overwrites()

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

Sets entry pos in list of entities overwriting entity ent.

◆ set_entity_overwrittenby()

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

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

◆ set_entity_owner()

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.

◆ set_entity_parameter_number()

void set_entity_parameter_number ( ir_entity entity,
size_t  n 
)

Sets the parameter number of the parameter which entity represents.

◆ set_entity_type()

void set_entity_type ( ir_entity ent,
ir_type tp 
)

Sets the type of an entity.

◆ set_entity_usage()

void set_entity_usage ( ir_entity ent,
ir_entity_usage  flag 
)

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

◆ set_entity_visibility()

void set_entity_visibility ( ir_entity entity,
ir_visibility  visibility 
)

Sets visibility class of an entity.

◆ set_entity_visited()

void set_entity_visited ( ir_entity ent,
ir_visited_t  num 
)

Sets the entities visited counter.

See also
Visited Counters

◆ set_entity_volatility()

void set_entity_volatility ( ir_entity ent,
ir_volatility  vol 
)

Sets the volatility of an entity.

◆ set_entity_vtable_number()

void set_entity_vtable_number ( ir_entity ent,
unsigned  vtable_number 
)

Sets the entity vtable number.