GDB (xrefs)
Classes | Defines | Enumerations | Functions | Variables
/home/stan/gdb/src/gdb/opencl-lang.c File Reference
#include "defs.h"
#include "gdb_string.h"
#include "gdbtypes.h"
#include "symtab.h"
#include "expression.h"
#include "parser-defs.h"
#include "language.h"
#include "c-lang.h"
#include "gdb_assert.h"

Go to the source code of this file.

Classes

struct  lval_closure

Defines

#define OCL_P_TYPE(TYPE)
#define HEXCHAR_TO_INT(C)
#define OCL_STRING(S)   #S
#define BUILD_OCL_VTYPES(TYPE)

Enumerations

enum  opencl_primitive_types {
  OCL_P_TYPE = (char), OCL_P_TYPE = (char), OCL_P_TYPE = (char), OCL_P_TYPE = (char),
  OCL_P_TYPE = (char), OCL_P_TYPE = (char), OCL_P_TYPE = (char), OCL_P_TYPE = (char),
  OCL_P_TYPE = (char), OCL_P_TYPE = (char), OCL_P_TYPE = (char), opencl_primitive_type_bool,
  opencl_primitive_type_unsigned_char, opencl_primitive_type_unsigned_short, opencl_primitive_type_unsigned_int, opencl_primitive_type_unsigned_long,
  opencl_primitive_type_size_t, opencl_primitive_type_ptrdiff_t, opencl_primitive_type_intptr_t, opencl_primitive_type_uintptr_t,
  opencl_primitive_type_void, nr_opencl_primitive_types
}

Functions

void _initialize_opencl_language (void)
static struct type ** builtin_opencl_type (struct gdbarch *gdbarch)
static struct typelookup_opencl_vector_type (struct gdbarch *gdbarch, enum type_code code, unsigned int el_length, unsigned int flag_unsigned, int n)
static int array_has_dups (int *arr, int n)
static struct lval_closureallocate_lval_closure (int *indices, int n, struct value *val)
static void lval_func_read (struct value *v)
static void lval_func_write (struct value *v, struct value *fromval)
static int lval_func_check_validity (const struct value *v, int offset, int length)
static int lval_func_check_any_valid (const struct value *v)
static int lval_func_check_synthetic_pointer (const struct value *v, int offset, int length)
static void * lval_func_copy_closure (const struct value *v)
static void lval_func_free_closure (struct value *v)
static struct valuecreate_value (struct gdbarch *gdbarch, struct value *val, enum noside noside, int *indices, int n)
static struct valueopencl_component_ref (struct expression *exp, struct value *val, char *comps, enum noside noside)
static struct valueopencl_logical_not (struct expression *exp, struct value *arg)
static int scalar_relop (struct value *val1, struct value *val2, enum exp_opcode op)
static struct valuevector_relop (struct expression *exp, struct value *val1, struct value *val2, enum exp_opcode op)
static struct valueopencl_value_cast (struct type *type, struct value *arg)
static struct valueopencl_relop (struct expression *exp, struct value *arg1, struct value *arg2, enum exp_opcode op)
static struct valueevaluate_subexp_opencl (struct type *expect_type, struct expression *exp, int *pos, enum noside noside)
static void opencl_print_type (struct type *type, const char *varstring, struct ui_file *stream, int show, int level, const struct type_print_options *flags)
static void opencl_language_arch_info (struct gdbarch *gdbarch, struct language_arch_info *lai)
static void * build_opencl_types (struct gdbarch *gdbarch)

Variables

static struct gdbarch_dataopencl_type_data
static struct lval_funcs opencl_value_funcs
struct exp_descriptor exp_descriptor_opencl
struct language_defn opencl_language_defn
initialize_file_ftype _initialize_opencl_language

Define Documentation

#define BUILD_OCL_VTYPES (   TYPE)
Value:
types[opencl_primitive_type_##TYPE##2] \
    = init_vector_type (types[opencl_primitive_type_##TYPE], 2); \
  TYPE_NAME (types[opencl_primitive_type_##TYPE##2]) = OCL_STRING(TYPE ## 2); \
  types[opencl_primitive_type_##TYPE##3] \
    = init_vector_type (types[opencl_primitive_type_##TYPE], 3); \
  TYPE_NAME (types[opencl_primitive_type_##TYPE##3]) = OCL_STRING(TYPE ## 3); \
  TYPE_LENGTH (types[opencl_primitive_type_##TYPE##3]) \
    = 4 * TYPE_LENGTH (types[opencl_primitive_type_##TYPE]); \
  types[opencl_primitive_type_##TYPE##4] \
    = init_vector_type (types[opencl_primitive_type_##TYPE], 4); \
  TYPE_NAME (types[opencl_primitive_type_##TYPE##4]) = OCL_STRING(TYPE ## 4); \
  types[opencl_primitive_type_##TYPE##8] \
    = init_vector_type (types[opencl_primitive_type_##TYPE], 8); \
  TYPE_NAME (types[opencl_primitive_type_##TYPE##8]) = OCL_STRING(TYPE ## 8); \
  types[opencl_primitive_type_##TYPE##16] \
    = init_vector_type (types[opencl_primitive_type_##TYPE], 16); \
  TYPE_NAME (types[opencl_primitive_type_##TYPE##16]) = OCL_STRING(TYPE ## 16)

Referenced by build_opencl_types().

#define HEXCHAR_TO_INT (   C)
Value:
((C >= '0' && C <= '9') ? \
                           C-'0' : ((C >= 'A' && C <= 'F') ? \
                           C-'A'+10 : ((C >= 'a' && C <= 'f') ? \
                           C-'a'+10 : -1)))

Referenced by opencl_component_ref().

#define OCL_P_TYPE (   TYPE)
Value:
opencl_primitive_type_##TYPE,\
  opencl_primitive_type_##TYPE##2,\
  opencl_primitive_type_##TYPE##3,\
  opencl_primitive_type_##TYPE##4,\
  opencl_primitive_type_##TYPE##8,\
  opencl_primitive_type_##TYPE##16

Definition at line 36 of file opencl-lang.c.

#define OCL_STRING (   S)    #S

Enumeration Type Documentation

Enumerator:
OCL_P_TYPE 
OCL_P_TYPE 
OCL_P_TYPE 
OCL_P_TYPE 
OCL_P_TYPE 
OCL_P_TYPE 
OCL_P_TYPE 
OCL_P_TYPE 
OCL_P_TYPE 
OCL_P_TYPE 
OCL_P_TYPE 
opencl_primitive_type_bool 
opencl_primitive_type_unsigned_char 
opencl_primitive_type_unsigned_short 
opencl_primitive_type_unsigned_int 
opencl_primitive_type_unsigned_long 
opencl_primitive_type_size_t 
opencl_primitive_type_ptrdiff_t 
opencl_primitive_type_intptr_t 
opencl_primitive_type_uintptr_t 
opencl_primitive_type_void 
nr_opencl_primitive_types 

Definition at line 44 of file opencl-lang.c.


Function Documentation

void _initialize_opencl_language ( void  )
static struct lval_closure* allocate_lval_closure ( int indices,
int  n,
struct value val 
) [static, read]
static int array_has_dups ( int arr,
int  n 
) [static]

Definition at line 122 of file opencl-lang.c.

Referenced by create_value().

static void* build_opencl_types ( struct gdbarch gdbarch) [static]
static struct type** builtin_opencl_type ( struct gdbarch gdbarch) [static, read]

Definition at line 72 of file opencl-lang.c.

References gdbarch_data().

Referenced by lookup_opencl_vector_type(), and opencl_language_arch_info().

static struct value* create_value ( struct gdbarch gdbarch,
struct value val,
enum noside  noside,
int indices,
int  n 
) [static, read]
static struct value* evaluate_subexp_opencl ( struct type expect_type,
struct expression exp,
int pos,
enum noside  noside 
) [static, read]
static struct type* lookup_opencl_vector_type ( struct gdbarch gdbarch,
enum type_code  code,
unsigned int  el_length,
unsigned int  flag_unsigned,
int  n 
) [static, read]
static int lval_func_check_any_valid ( const struct value v) [static]
static int lval_func_check_synthetic_pointer ( const struct value v,
int  offset,
int  length 
) [static]
static int lval_func_check_validity ( const struct value v,
int  offset,
int  length 
) [static]
static void* lval_func_copy_closure ( const struct value v) [static]

Definition at line 333 of file opencl-lang.c.

References lval_closure::refc, and value_computed_closure().

static void lval_func_free_closure ( struct value v) [static]
static void lval_func_read ( struct value v) [static]
static void lval_func_write ( struct value v,
struct value fromval 
) [static]
static struct value* opencl_component_ref ( struct expression exp,
struct value val,
char *  comps,
enum noside  noside 
) [static, read]
static void opencl_language_arch_info ( struct gdbarch gdbarch,
struct language_arch_info lai 
) [static]
static struct value* opencl_logical_not ( struct expression exp,
struct value arg 
) [static, read]
static void opencl_print_type ( struct type type,
const char *  varstring,
struct ui_file stream,
int  show,
int  level,
const struct type_print_options flags 
) [static]
static struct value* opencl_relop ( struct expression exp,
struct value arg1,
struct value arg2,
enum exp_opcode  op 
) [static, read]
static struct value* opencl_value_cast ( struct type type,
struct value arg 
) [static, read]
static int scalar_relop ( struct value val1,
struct value val2,
enum exp_opcode  op 
) [static]

Definition at line 595 of file opencl-lang.c.

References _, error(), value_equal(), value_less(), and value_logical_not().

Referenced by opencl_relop(), and vector_relop().

static struct value* vector_relop ( struct expression exp,
struct value val1,
struct value val2,
enum exp_opcode  op 
) [static, read]

Variable Documentation

Definition at line 1234 of file opencl-lang.c.

Referenced by initialize_all_files().

Definition at line 1102 of file opencl-lang.c.

struct gdbarch_data* opencl_type_data [static]

Definition at line 69 of file opencl-lang.c.

struct lval_funcs opencl_value_funcs [static]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines