Code Listener  [unstable] git snapshot
Data Fields
cl_type Struct Reference

type definition available for each operand. More...

#include <code_listener.h>

Collaboration diagram for cl_type:
Collaboration graph
[legend]

Data Fields

int uid
 type's unique ID More...
 
enum cl_type_e code
 kind of type (enumeration) More...
 
struct cl_loc loc
 location of type's declaration (may or may not be valid) More...
 
enum cl_scope_e scope
 scope of type's declaration More...
 
const char * name
 type's name, or NULL for anonymous type More...
 
int size
 type's sizeof More...
 
int item_cnt
 count of nested types More...
 
struct cl_type_itemitems
 array of nested types. More...
 
int array_size
 valid only for CL_TYPE_ARRAY More...
 
bool is_unsigned
 makes sense mainly for integral types, but should be always initialized More...
 

Detailed Description

type definition available for each operand.

It can be also returned by cl_get_type_fnc_t function (useful to traverse type definition recursively).

Definition at line 213 of file code_listener.h.

Field Documentation

int array_size

valid only for CL_TYPE_ARRAY

Definition at line 266 of file code_listener.h.

enum cl_type_e code

kind of type (enumeration)

Definition at line 222 of file code_listener.h.

Referenced by isCodePtr(), isComposite(), isDataPtr(), and isLcVar().

bool is_unsigned

makes sense mainly for integral types, but should be always initialized

Definition at line 271 of file code_listener.h.

int item_cnt

count of nested types

  • 0 for elementary types
  • 1 for e.g. CL_TYPE_PTR and CL_TYPE_ARRAY
  • n for e.g. CL_TYPE_STRUCT and CL_TYPE_UNION
  • 0 < n for CL_TYPE_FNC

Definition at line 256 of file code_listener.h.

Referenced by traverseTypeIc().

struct cl_type_item* items

array of nested types.

Its size is exactly item_cnt.

Definition at line 261 of file code_listener.h.

struct cl_loc loc

location of type's declaration (may or may not be valid)

Definition at line 227 of file code_listener.h.

const char* name

type's name, or NULL for anonymous type

Attention
Even if the type is named, the name is not guaranteed to be unique. Neither the C language guarantees anything like that. This field is suitable only for error/warning messages and debugging. Types are distinguishable by cl_type::uid and never ever by cl_type::name.

Definition at line 241 of file code_listener.h.

enum cl_scope_e scope

scope of type's declaration

Definition at line 232 of file code_listener.h.

int size

type's sizeof

Definition at line 246 of file code_listener.h.

Referenced by TypeDb::size().

int uid

type's unique ID

Definition at line 217 of file code_listener.h.

Referenced by traverseTypeIc().


The documentation for this struct was generated from the following file: