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

Typedefs

typedef struct ir_entity ir_entity
 Entity.

Enumerations

enum  ir_visibility { ir_visibility_external, 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
}
 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...
enum  ir_allocation { allocation_automatic, allocation_parameter, allocation_dynamic, allocation_static }
enum  ir_peculiarity { peculiarity_existent, peculiarity_description, peculiarity_inherited }

Functions

ir_visibility get_entity_visibility (const ir_entity *entity)
 Returns the visibility class of an entity.
void set_entity_visibility (ir_entity *entity, ir_visibility visibility)
 Sets visibility class of an entity.
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).
int entity_has_definition (const ir_entity *entity)
 Returns 1 if the entity has a definition (initializer) in the current compilation unit.
ir_entitynew_entity (ir_type *owner, ident *name, ir_type *tp)
 Creates a new entity.
ir_entitynew_d_entity (ir_type *owner, ident *name, ir_type *tp, dbg_info *db)
 Creates a new entity.
ir_entitynew_parameter_entity (ir_type *owner, size_t pos, ir_type *type)
 Creates a new entity corresponding to a function parameter.
ir_entitynew_d_parameter_entity (ir_type *owner, size_t pos, ir_type *type, dbg_info *dbgi)
 Like new_parameter_entity() but with debug information.
int check_entity (const ir_entity *ent)
 Check an entity.
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.
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.
void free_entity (ir_entity *ent)
 Frees the entity.
const char * get_entity_name (const ir_entity *ent)
 Returns the name of an entity.
identget_entity_ident (const ir_entity *ent)
 Returns the ident of an entity.
void set_entity_ident (ir_entity *ent, ident *id)
 Sets the ident of the entity.
identget_entity_ld_ident (const ir_entity *ent)
 Returns the mangled name of the entity.
void set_entity_ld_ident (ir_entity *ent, ident *ld_ident)
 Sets the mangled name of the entity.
const char * get_entity_ld_name (const ir_entity *ent)
 Returns the mangled name of the entity as a string.
int entity_has_ld_ident (const ir_entity *entity)
 returns 1 if the entity has an ld_ident set explicitely
ir_typeget_entity_owner (const ir_entity *ent)
 Returns the owner of the entity.
void set_entity_owner (ir_entity *ent, ir_type *owner)
 Sets the owner field in entity to owner.
ir_typeget_entity_type (const ir_entity *ent)
 Returns the type of an entity.
void set_entity_type (ir_entity *ent, ir_type *tp)
 Sets the type of an entity.
ir_linkage get_entity_linkage (const ir_entity *entity)
 Returns the linkage of an entity.
void set_entity_linkage (ir_entity *entity, ir_linkage linkage)
 Sets the linkage flags of entity entity to linkage.
void add_entity_linkage (ir_entity *entity, ir_linkage linkage)
 Adds linkage flags linkage to entity entity.
void remove_entity_linkage (ir_entity *entity, ir_linkage linkage)
 Remove linkage flags linkage from entity entity.
ir_volatility get_entity_volatility (const ir_entity *ent)
 Returns the volatility of an entity.
void set_entity_volatility (ir_entity *ent, ir_volatility vol)
 Sets the volatility of an entity.
const char * get_volatility_name (ir_volatility var)
 Returns the name of the volatility.
unsigned get_entity_alignment (const ir_entity *entity)
 Returns alignment of entity in bytes.
void set_entity_alignment (ir_entity *entity, unsigned alignment)
 Allows you to override the type alignment for an entity.
ir_align get_entity_aligned (const ir_entity *ent)
 Returns indication whether entity is aligned in memory.
void set_entity_aligned (ir_entity *ent, ir_align a)
 Sets indication whether entity is aligned in memory.
const char * get_align_name (ir_align a)
 Returns the name of the alignment.
int get_entity_offset (const ir_entity *ent)
 Returns the offset of an entity (in a compound) in bytes.
void set_entity_offset (ir_entity *ent, int offset)
 Sets the offset of an entity (in a compound) in bytes.
unsigned char get_entity_offset_bits_remainder (const ir_entity *ent)
 Returns the offset bit remainder of a bitfield entity (in a compound) in bits.
void set_entity_offset_bits_remainder (ir_entity *ent, unsigned char offset)
 Sets the offset bit remainder of a bitfield entity (in a compound) in bits.
void * get_entity_link (const ir_entity *ent)
 Returns the stored intermediate information.
void set_entity_link (ir_entity *ent, void *l)
 Stores new intermediate information.
ir_graphget_entity_irg (const ir_entity *ent)
 The entity knows the corresponding irg if the entity is a method.
unsigned get_entity_vtable_number (const ir_entity *ent)
 Returns the entity vtable number.
void set_entity_vtable_number (ir_entity *ent, unsigned vtable_number)
 Sets the entity vtable number.
void set_entity_label (ir_entity *ent, ir_label_t label)
 Sets label number of an entity with code type.
ir_label_t get_entity_label (const ir_entity *ent)
 Returns label number of an entity with code type.
int is_entity_compiler_generated (const ir_entity *ent)
 Checks if an entity is compiler generated.
void set_entity_compiler_generated (ir_entity *ent, int flag)
 Sets/resets the compiler generated flag.
ir_entity_usage get_entity_usage (const ir_entity *ent)
 Returns the 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.
dbg_infoget_entity_dbg_info (const ir_entity *ent)
 Returns the debug information of an entity.
void set_entity_dbg_info (ir_entity *ent, dbg_info *db)
 Sets the debug information of an 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
size_t get_entity_parameter_number (const ir_entity *entity)
 returns number of parameter a parameter entitiy represents
void set_entity_parameter_number (ir_entity *entity, size_t n)
 set number of parameter an entity represents
int is_irn_const_expression (ir_node *n)
 Returns true if the the node is representable as code on const_code_irg.
ir_nodecopy_const_value (dbg_info *dbg, ir_node *n, ir_node *to_block)
 Copies a Firm subgraph that complies to the restrictions for constant expressions to block.
ir_nodeget_atomic_ent_value (const ir_entity *ent)
 Returns initial value of entity with atomic type ent.
void set_atomic_ent_value (ir_entity *ent, ir_node *val)
 Sets initial value of entity with atomic type ent to node val.
void set_entity_initializer (ir_entity *entity, ir_initializer_t *initializer)
 Sets the new style initializers of an entity.
int has_entity_initializer (const ir_entity *entity)
 Returns true, if an entity has new style initializers.
ir_initializer_tget_entity_initializer (const ir_entity *entity)
 Returns the new style initializers of an entity.
void add_entity_overwrites (ir_entity *ent, ir_entity *overwritten)
 Adds entity ent to the list of entities that overwrite overwritten.
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_overwrites_index (const ir_entity *ent, ir_entity *overwritten)
 Returns index of overwritten in list of entities overwriting entity ent.
ir_entityget_entity_overwrites (const ir_entity *ent, size_t pos)
 Returns entry pos in list of entities overwriting entity ent.
void set_entity_overwrites (ir_entity *ent, size_t pos, ir_entity *overwritten)
 Sets entry pos in list of entities overwriting entity ent.
void remove_entity_overwrites (ir_entity *ent, ir_entity *overwritten)
 Remove overwritten from list of entities overwriting entity ent.
size_t get_entity_n_overwrittenby (const ir_entity *ent)
 Returns number of entities overwritten by 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_entityget_entity_overwrittenby (const ir_entity *ent, size_t pos)
 Return entry pos in list of entities overwritten by 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 remove_entity_overwrittenby (ir_entity *ent, ir_entity *overwrites)
 Removes entry overwrites in list of entities overwritten by ent.
int is_entity (const void *thing)
 Checks whether a pointer points to an entity.
int is_atomic_entity (const ir_entity *ent)
 Returns true if the type of the entity is a primitive, pointer enumeration or method 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 type of the entity is a Method type.
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.
ir_visited_t get_entity_visited (const ir_entity *ent)
 Returns the entities visited counter.
void set_entity_visited (ir_entity *ent, ir_visited_t num)
 Sets the entities visited counter.
void mark_entity_visited (ir_entity *ent)
 Marks entity as visited.
int entity_visited (const ir_entity *ent)
 Returns true if this entity was visited.
int entity_not_visited (const ir_entity *ent)
 Returns true if this entity was not visited.
mtp_additional_properties get_entity_additional_properties (const ir_entity *ent)
 Returns the mask of the additional entity properties.
void set_entity_additional_properties (ir_entity *ent, mtp_additional_properties prop)
 Sets the mask of the additional graph properties.
void add_entity_additional_properties (ir_entity *ent, mtp_additional_properties flag)
 Sets additional graph properties.
ir_typeget_entity_repr_class (const ir_entity *ent)
 Returns the class type that this type info entity represents or NULL if ent is no type info entity.
ir_entityget_unknown_entity (void)
 Returns the unknown entity .
int is_unknown_entity (const ir_entity *entity)
 Tests whether entity entity is (the) unknown entity.
ir_allocation get_entity_allocation (const ir_entity *ent)
void set_entity_allocation (ir_entity *ent, ir_allocation al)
ir_peculiarity get_entity_peculiarity (const ir_entity *ent)
void set_entity_peculiarity (ir_entity *ent, ir_peculiarity pec)
int is_entity_final (const ir_entity *ent)
void set_entity_final (ir_entity *ent, int final)
ir_peculiarity get_class_peculiarity (const ir_type *clss)
void set_class_peculiarity (ir_type *clss, ir_peculiarity pec)

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 = SymConst(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 452 of file typerep.h.

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

A reserved value for "not yet set".

Definition at line 388 of file typerep.h.

Typedef Documentation

typedef struct ir_entity ir_entity

Entity.

Definition at line 96 of file firm_types.h.

Enumeration Type Documentation

Definition at line 705 of file typerep.h.

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

enum ir_linkage

linkage specifies how the linker treats symbols

Enumerator:
IR_LINKAGE_CONSTANT 

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

Optimisation 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".

Definition at line 121 of file typerep.h.

Definition at line 717 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_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 92 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.

Currently, we check only if initialized constants are build on the const irg graph.

Returns
non-zero if no errors were found
ir_node* copy_const_value ( dbg_info dbg,
ir_node n,
ir_node to_block 
)

Copies a Firm subgraph that complies to the restrictions for constant expressions to block.

Parameters
dbgdebug info for all newly created nodes
nthe node
to_blockblock to copy to
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_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.

ir_peculiarity get_class_peculiarity ( const ir_type clss)
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_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.

ir_allocation get_entity_allocation ( const ir_entity ent)
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)

The entity knows the corresponding irg if the entity is a method.

This allows to get from a Call to the called 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.

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

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

Only set if layout = fixed.

unsigned char get_entity_offset_bits_remainder ( const ir_entity ent)

Returns the offset bit remainder of a bitfield entity (in a compound) in bits.

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_peculiarity get_entity_peculiarity ( const ir_entity ent)
ir_type* get_entity_repr_class ( const ir_entity ent)

Returns the class type that this type info entity represents or NULL if ent is no type info entity.

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 has_entity_initializer ( const ir_entity entity)

Returns true, if an entity has new style initializers.

int is_atomic_entity ( const ir_entity ent)

Returns true if the type of the entity is a primitive, pointer enumeration 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_entity ( const void *  thing)

Checks whether a pointer points to an entity.

Parameters
thingan arbitrary pointer
Returns
true if the thing is an entity, else false
int is_entity_compiler_generated ( const ir_entity ent)

Checks if an entity is compiler generated.

int is_entity_final ( const ir_entity ent)
int is_irn_const_expression ( ir_node n)

Returns true if the the node is representable as code on const_code_irg.

int is_method_entity ( const ir_entity ent)

Returns true if the type of the entity is a Method type.

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_d_entity ( ir_type owner,
ident name,
ir_type tp,
dbg_info db 
)

Creates a new entity.

Automatically inserts the entity as a member of owner. The entity is automatic allocated and uninitialized except if the type is type_method, then it is static allocated and constant. The constant value is a pointer to the method. Visibility is local, offset -1, and it is not volatile.

ir_entity* new_d_parameter_entity ( ir_type owner,
size_t  pos,
ir_type type,
dbg_info dbgi 
)

Like new_parameter_entity() but with debug information.

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. The constant value is a pointer to the method. Visibility is local, offset -1, and it is not volatile.

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_class_peculiarity ( ir_type clss,
ir_peculiarity  pec 
)
void set_entity_additional_properties ( ir_entity ent,
mtp_additional_properties  prop 
)

Sets the mask of the additional graph properties.

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_allocation ( ir_entity ent,
ir_allocation  al 
)
void set_entity_compiler_generated ( ir_entity ent,
int  flag 
)

Sets/resets the compiler generated flag.

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_final ( ir_entity ent,
int  final 
)
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 ent,
int  offset 
)

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

void set_entity_offset_bits_remainder ( ir_entity ent,
unsigned char  offset 
)

Sets the offset bit remainder of a bitfield entity (in a compound) in bits.

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_peculiarity ( ir_entity ent,
ir_peculiarity  pec 
)
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.