GDB (xrefs)
Classes | Macros | Enumerations | Functions | Variables
/tmp/gdb-7.10/gdb/opencl-lang.c File Reference
#include "defs.h"
#include "gdbtypes.h"
#include "symtab.h"
#include "expression.h"
#include "parser-defs.h"
#include "language.h"
#include "varobj.h"
#include "c-lang.h"

Go to the source code of this file.

Classes

struct  lval_closure
 

Macros

#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_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 const struct lval_funcs opencl_value_funcs
 
const struct exp_descriptor exp_descriptor_opencl
 
const struct language_defn opencl_language_defn
 
initialize_file_ftype _initialize_opencl_language
 

Macro Definition 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)
#define OCL_STRING(S)
#define TYPE_NAME(thistype)
Definition: gdbtypes.h:1227
struct type * init_vector_type(struct type *elt_type, int n)
Definition: gdbtypes.c:1229
#define TYPE_LENGTH(thistype)
Definition: gdbtypes.h:1237

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 34 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 42 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
static int array_has_dups ( int arr,
int  n 
)
static

Definition at line 120 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

Definition at line 70 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
static struct value* evaluate_subexp_opencl ( struct type expect_type,
struct expression exp,
int pos,
enum noside  noside 
)
static
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
static int lval_func_check_synthetic_pointer ( const struct value v,
int  offset,
int  length 
)
static
static void* lval_func_copy_closure ( const struct value v)
static

Definition at line 279 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
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
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
static struct value* opencl_value_cast ( struct type type,
struct value arg 
)
static
static int scalar_relop ( struct value val1,
struct value val2,
enum exp_opcode  op 
)
static

Definition at line 539 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

Variable Documentation

initialize_file_ftype _initialize_opencl_language
const struct exp_descriptor exp_descriptor_opencl
Initial value:
=
{
}
static struct value * evaluate_subexp_opencl(struct type *expect_type, struct expression *exp, int *pos, enum noside noside)
Definition: opencl-lang.c:729
int dump_subexp_body_standard(struct expression *exp, struct ui_file *stream, int elt)
Definition: expprint.c:762
char * op_name_standard(enum exp_opcode opcode)
Definition: expprint.c:662
void print_subexp_standard(struct expression *exp, int *pos, struct ui_file *stream, enum precedence prec)
Definition: expprint.c:58
int operator_check_standard(struct expression *exp, int pos, int(*objfile_func)(struct objfile *objfile, void *data), void *data)
Definition: parse.c:1782
void operator_length_standard(const struct expression *expr, int endpos, int *oplenp, int *argsp)
Definition: parse.c:859

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

const struct language_defn opencl_language_defn

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

struct gdbarch_data* opencl_type_data
static

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

const struct lval_funcs opencl_value_funcs
static
Initial value:
=
{
NULL,
NULL,
}
static void lval_func_free_closure(struct value *v)
Definition: opencl-lang.c:289
static int lval_func_check_synthetic_pointer(const struct value *v, int offset, int length)
Definition: opencl-lang.c:245
static void lval_func_read(struct value *v)
Definition: opencl-lang.c:170
static void * lval_func_copy_closure(const struct value *v)
Definition: opencl-lang.c:279
static void lval_func_write(struct value *v, struct value *fromval)
Definition: opencl-lang.c:198

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