libFirm
Identifiers

Typedefs

typedef struct ident ident
 Identifier.

Functions

identnew_id_from_str (const char *str)
 Store a string and create an ident.
identnew_id_from_chars (const char *str, size_t len)
 Store a string and create an ident.
const char * get_id_str (ident *id)
 Returns a string represented by an ident.
size_t get_id_strlen (ident *id)
 Returns the length of the string represented by an ident.
int id_is_prefix (ident *prefix, ident *id)
 Test if prefix is a prefix of ident id.
int id_is_suffix (ident *suffix, ident *id)
 Test if suffix is a suffix of ident id.
int id_contains_char (ident *id, char c)
 Test if identifier contains a given character.
identid_unique (const char *tag)
 helper function for creating unique idents.
identid_mangle_u (ident *first, ident *scnd)
 mangle underscore: Returns a new ident that represents first_scnd.
identid_mangle_dot (ident *first, ident *scnd)
 mangle dot: Returns a new ident that represents first.scnd.
identid_mangle (ident *first, ident *scnd)
 mangle: Returns a new ident that represents firstscnd.
identid_mangle3 (const char *prefix, ident *middle, const char *suffix)
 Returns a new ident that represents 'prefixscndsuffix'.

Detailed Description

Typedef Documentation

typedef struct ident ident

Identifier.

Definition at line 60 of file firm_types.h.

Function Documentation

const char* get_id_str ( ident id)

Returns a string represented by an ident.

Returns the string represented by id. This string is NULL terminated. The string may not be changed.

Parameters
idthe ident
Returns
cp a string
size_t get_id_strlen ( ident id)

Returns the length of the string represented by an ident.

Parameters
idthe ident
Returns
len the length of the string
int id_contains_char ( ident id,
char  c 
)

Test if identifier contains a given character.

Parameters
idthe ident
cthe character
Returns
1 if character is contained, 0 otherwise
int id_is_prefix ( ident prefix,
ident id 
)

Test if prefix is a prefix of ident id.

Parameters
prefixthe prefix
idthe ident
Returns
1 if prefix is prefix of id, 0 otherwise
int id_is_suffix ( ident suffix,
ident id 
)

Test if suffix is a suffix of ident id.

Parameters
suffixthe suffix
idthe ident
Returns
1 if suffix is suffix of id, 0 otherwise
ident* id_mangle ( ident first,
ident scnd 
)

mangle: Returns a new ident that represents firstscnd.

ident* id_mangle3 ( const char *  prefix,
ident middle,
const char *  suffix 
)

Returns a new ident that represents 'prefixscndsuffix'.

ident* id_mangle_dot ( ident first,
ident scnd 
)

mangle dot: Returns a new ident that represents first.scnd.

ident* id_mangle_u ( ident first,
ident scnd 
)

mangle underscore: Returns a new ident that represents first_scnd.

ident* id_unique ( const char *  tag)

helper function for creating unique idents.

It contains an internal counter and replaces a "%u" inside the tag with the counter.

ident* new_id_from_chars ( const char *  str,
size_t  len 
)

Store a string and create an ident.

Stores a string in the ident module and returns a handle for the string. Copies the string. This version takes non-zero-terminated strings.

Parameters
strthe string (or whatever) which shall be stored
lenthe length of the data in bytes
Returns
id a handle for the generated ident
ident* new_id_from_str ( const char *  str)

Store a string and create an ident.

Stores a string in the ident module and returns a handle for the string.

Copies the string. str must be zero terminated

Parameters
strthe string which shall be stored
Returns
id a handle for the generated ident