aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-exp.y
diff options
context:
space:
mode:
authorKen Werner <ken.werner@de.ibm.com>2010-11-05 14:31:30 +0000
committerKen Werner <ken.werner@de.ibm.com>2010-11-05 14:31:30 +0000
commitf4b8a18de7f165283091323b11e9e363dadb8b62 (patch)
tree5e42a431d5add30b82af29bebc879a9c49f6ef07 /gdb/c-exp.y
parentaa291e2d99dd5e6be27b43c721fa92edae076138 (diff)
downloadgdb-f4b8a18de7f165283091323b11e9e363dadb8b62.zip
gdb-f4b8a18de7f165283091323b11e9e363dadb8b62.tar.gz
gdb-f4b8a18de7f165283091323b11e9e363dadb8b62.tar.bz2
gdb:
* NEWS: Mention OpenCL C language support. * Makefile.in (SFILES): Add opencl-lang.c. (COMMON_OBS): Add opencl-lang.o. * opencl-lang.c: New File * defs.h (enum language): Add language_opencl. * dwarf2read.c (read_file_scope): Handle DW_AT_producer for the IBM XL C OpenCL compiler. * c-lang.h: Include "parser-defs.h". (evaluate_subexp_c): Declare. * c-lang.c (evaluate_subexp_c): Remove the static qualifier. (c_op_print_tab): Add declaration. * eval.c (binop_promote): Handle language_opencl. * c-exp.y: Lookup the primitive types instead of referring to the builtins. gdb/testsuite: * Makefile.in (ALL_SUBDIRS): Add gdb.opencl. * configure.ac (AC_OUTPUT): Add gdb.opencl/Makefile. * configure: Regenerate. * gdb.opencl/Makefile.in: New File. * gdb.opencl/datatypes.exp: Likewise. * gdb.opencl/datatypes.cl: Likewise. * gdb.opencl/operators.exp: Likewise. * gdb.opencl/operators.cl: Likewise. * gdb.opencl/vec_comps.exp: Likewise. * gdb.opencl/vec_comps.cl: Likewise. * gdb.opencl/convs_casts.exp: Likewise. * gdb.opencl/convs_casts.cl: Likewise. * lib/opencl.exp: Likewise. * lib/opencl_hostapp.c: Likewise. * lib/opencl_kernel.cl: Likewise. * lib/cl_util.c: Likewise. * lib/cl_util.c: Likewise. * gdb.base/default.exp (set language): Add "opencl" to the list of languages. gdb/doc: * gdb.texinfo: (Summary) Add mention about OpenCL C language support. (OpenCL C): New node.
Diffstat (limited to 'gdb/c-exp.y')
-rw-r--r--gdb/c-exp.y136
1 files changed, 102 insertions, 34 deletions
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 57e09b3..2e6c371 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -612,7 +612,9 @@ exp : VARIABLE
exp : SIZEOF '(' type ')' %prec UNARY
{ write_exp_elt_opcode (OP_LONG);
- write_exp_elt_type (parse_type->builtin_int);
+ write_exp_elt_type (lookup_signed_typename
+ (parse_language, parse_gdbarch,
+ "int"));
CHECK_TYPEDEF ($3);
write_exp_elt_longcst ((LONGEST) TYPE_LENGTH ($3));
write_exp_elt_opcode (OP_LONG); }
@@ -980,61 +982,117 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */
: TYPENAME
{ $$ = $1.type; }
| INT_KEYWORD
- { $$ = parse_type->builtin_int; }
+ { $$ = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "int"); }
| LONG
- { $$ = parse_type->builtin_long; }
+ { $$ = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "long"); }
| SHORT
- { $$ = parse_type->builtin_short; }
+ { $$ = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "short"); }
| LONG INT_KEYWORD
- { $$ = parse_type->builtin_long; }
+ { $$ = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "long"); }
| LONG SIGNED_KEYWORD INT_KEYWORD
- { $$ = parse_type->builtin_long; }
+ { $$ = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "long"); }
| LONG SIGNED_KEYWORD
- { $$ = parse_type->builtin_long; }
+ { $$ = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "long"); }
| SIGNED_KEYWORD LONG INT_KEYWORD
- { $$ = parse_type->builtin_long; }
+ { $$ = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "long"); }
| UNSIGNED LONG INT_KEYWORD
- { $$ = parse_type->builtin_unsigned_long; }
+ { $$ = lookup_unsigned_typename (parse_language,
+ parse_gdbarch,
+ "long"); }
| LONG UNSIGNED INT_KEYWORD
- { $$ = parse_type->builtin_unsigned_long; }
+ { $$ = lookup_unsigned_typename (parse_language,
+ parse_gdbarch,
+ "long"); }
| LONG UNSIGNED
- { $$ = parse_type->builtin_unsigned_long; }
+ { $$ = lookup_unsigned_typename (parse_language,
+ parse_gdbarch,
+ "long"); }
| LONG LONG
- { $$ = parse_type->builtin_long_long; }
+ { $$ = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "long long"); }
| LONG LONG INT_KEYWORD
- { $$ = parse_type->builtin_long_long; }
+ { $$ = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "long long"); }
| LONG LONG SIGNED_KEYWORD INT_KEYWORD
- { $$ = parse_type->builtin_long_long; }
+ { $$ = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "long long"); }
| LONG LONG SIGNED_KEYWORD
- { $$ = parse_type->builtin_long_long; }
+ { $$ = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "long long"); }
| SIGNED_KEYWORD LONG LONG
- { $$ = parse_type->builtin_long_long; }
+ { $$ = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "long long"); }
| SIGNED_KEYWORD LONG LONG INT_KEYWORD
- { $$ = parse_type->builtin_long_long; }
+ { $$ = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "long long"); }
| UNSIGNED LONG LONG
- { $$ = parse_type->builtin_unsigned_long_long; }
+ { $$ = lookup_unsigned_typename (parse_language,
+ parse_gdbarch,
+ "long long"); }
| UNSIGNED LONG LONG INT_KEYWORD
- { $$ = parse_type->builtin_unsigned_long_long; }
+ { $$ = lookup_unsigned_typename (parse_language,
+ parse_gdbarch,
+ "long long"); }
| LONG LONG UNSIGNED
- { $$ = parse_type->builtin_unsigned_long_long; }
+ { $$ = lookup_unsigned_typename (parse_language,
+ parse_gdbarch,
+ "long long"); }
| LONG LONG UNSIGNED INT_KEYWORD
- { $$ = parse_type->builtin_unsigned_long_long; }
+ { $$ = lookup_unsigned_typename (parse_language,
+ parse_gdbarch,
+ "long long"); }
| SHORT INT_KEYWORD
- { $$ = parse_type->builtin_short; }
+ { $$ = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "short"); }
| SHORT SIGNED_KEYWORD INT_KEYWORD
- { $$ = parse_type->builtin_short; }
+ { $$ = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "short"); }
| SHORT SIGNED_KEYWORD
- { $$ = parse_type->builtin_short; }
+ { $$ = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "short"); }
| UNSIGNED SHORT INT_KEYWORD
- { $$ = parse_type->builtin_unsigned_short; }
+ { $$ = lookup_unsigned_typename (parse_language,
+ parse_gdbarch,
+ "short"); }
| SHORT UNSIGNED
- { $$ = parse_type->builtin_unsigned_short; }
+ { $$ = lookup_unsigned_typename (parse_language,
+ parse_gdbarch,
+ "short"); }
| SHORT UNSIGNED INT_KEYWORD
- { $$ = parse_type->builtin_unsigned_short; }
+ { $$ = lookup_unsigned_typename (parse_language,
+ parse_gdbarch,
+ "short"); }
| DOUBLE_KEYWORD
- { $$ = parse_type->builtin_double; }
+ { $$ = lookup_typename (parse_language, parse_gdbarch,
+ "double", (struct block *) NULL,
+ 0); }
| LONG DOUBLE_KEYWORD
- { $$ = parse_type->builtin_long_double; }
+ { $$ = lookup_typename (parse_language, parse_gdbarch,
+ "long double",
+ (struct block *) NULL, 0); }
| STRUCT name
{ $$ = lookup_struct (copy_name ($2),
expression_context_block); }
@@ -1052,13 +1110,17 @@ typebase /* Implements (approximately): (type-qualifier)* type-specifier */
parse_gdbarch,
TYPE_NAME($2.type)); }
| UNSIGNED
- { $$ = parse_type->builtin_unsigned_int; }
+ { $$ = lookup_unsigned_typename (parse_language,
+ parse_gdbarch,
+ "int"); }
| SIGNED_KEYWORD typename
{ $$ = lookup_signed_typename (parse_language,
parse_gdbarch,
TYPE_NAME($2.type)); }
| SIGNED_KEYWORD
- { $$ = parse_type->builtin_int; }
+ { $$ = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "int"); }
/* It appears that this rule for templates is never
reduced; template recognition happens by lookahead
in the token processing code in yylex. */
@@ -1077,19 +1139,25 @@ typename: TYPENAME
{
$$.stoken.ptr = "int";
$$.stoken.length = 3;
- $$.type = parse_type->builtin_int;
+ $$.type = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "int");
}
| LONG
{
$$.stoken.ptr = "long";
$$.stoken.length = 4;
- $$.type = parse_type->builtin_long;
+ $$.type = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "long");
}
| SHORT
{
$$.stoken.ptr = "short";
$$.stoken.length = 5;
- $$.type = parse_type->builtin_short;
+ $$.type = lookup_signed_typename (parse_language,
+ parse_gdbarch,
+ "short");
}
;