From: Simon Marchi Date: Mon, 31 Aug 2020 14:44:33 +0000 (-0400) Subject: gdb: remove NULL_TYPE X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fe1fe7eae95c43bcb1dfda8a6922eda0c9acd1c2;p=binutils-gdb.git gdb: remove NULL_TYPE The NULL_TYPE macro is not very useful... remove it and just use nullptr. gdb/ChangeLog: * gdbtypes.h (NULL_TYPE): Remove, change all uses to nullptr. Change-Id: Ic6215921413dad5649192b012f1a41d0a650a644 --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1ff47c3355d..8cb475d367a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2020-08-31 Simon Marchi + + * gdbtypes.h (NULL_TYPE): Remove, change all uses to nullptr. + 2020-08-29 Pedro Alves * progspace.c (print_program_space): Use all_inferiors. Switch to diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 29951528e5e..e405cd23d21 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -9147,7 +9147,7 @@ ada_enum_name (const char *name) static struct value * evaluate_subexp_type (struct expression *exp, int *pos) { - return evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS); + return evaluate_subexp (nullptr, exp, pos, EVAL_AVOID_SIDE_EFFECTS); } /* If VAL is wrapped in an aligner or subtype wrapper, return the @@ -10133,7 +10133,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, return ada_evaluate_subexp (type, exp, pos, noside); case BINOP_ASSIGN: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (exp->elts[*pos].opcode == OP_AGGREGATE) { arg1 = assign_aggregate (arg1, arg1, exp, pos, noside); @@ -10221,8 +10221,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, case BINOP_DIV: case BINOP_REM: case BINOP_MOD: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); + arg2 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; else if (noside == EVAL_AVOID_SIDE_EFFECTS) @@ -10243,7 +10243,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, case BINOP_EQUAL: case BINOP_NOTEQUAL: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; @@ -10260,7 +10260,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, return value_from_longest (type, (LONGEST) tem); case UNOP_NEG: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; else if (ada_is_gnat_encoded_fixed_point_type (value_type (arg1))) @@ -10289,8 +10289,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, { struct value *val; - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS); - *pos = pc; + arg1 = evaluate_subexp (nullptr, exp, pos, EVAL_AVOID_SIDE_EFFECTS); + *pos = pc; val = evaluate_subexp_standard (expect_type, exp, pos, noside); return value_cast (value_type (arg1), val); @@ -10341,7 +10341,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, a fixed type would result in the loss of that type name, thus preventing us from printing the name of the ancestor type in the type description. */ - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_NORMAL); + arg1 = evaluate_subexp (nullptr, exp, pos, EVAL_NORMAL); if (type->code () != TYPE_CODE_REF) { @@ -10404,8 +10404,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, else { for (tem = 0; tem <= nargs; tem += 1) - argvec[tem] = evaluate_subexp (NULL_TYPE, exp, pos, noside); - argvec[tem] = 0; + argvec[tem] = evaluate_subexp (nullptr, exp, pos, noside); + argvec[tem] = 0; if (noside == EVAL_SKIP) goto nosideret; @@ -10534,12 +10534,12 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, case TERNOP_SLICE: { - struct value *array = evaluate_subexp (NULL_TYPE, exp, pos, noside); - struct value *low_bound_val = - evaluate_subexp (NULL_TYPE, exp, pos, noside); - struct value *high_bound_val = - evaluate_subexp (NULL_TYPE, exp, pos, noside); - LONGEST low_bound; + struct value *array = evaluate_subexp (nullptr, exp, pos, noside); + struct value *low_bound_val + = evaluate_subexp (nullptr, exp, pos, noside); + struct value *high_bound_val + = evaluate_subexp (nullptr, exp, pos, noside); + LONGEST low_bound; LONGEST high_bound; low_bound_val = coerce_ref (low_bound_val); @@ -10617,7 +10617,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, case UNOP_IN_RANGE: (*pos) += 2; - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); type = check_typedef (exp->elts[pc + 1].type); if (noside == EVAL_SKIP) @@ -10649,8 +10649,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, case BINOP_IN_BOUNDS: (*pos) += 2; - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); + arg2 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; @@ -10681,9 +10681,9 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, || value_equal (arg2, arg1))); case TERNOP_IN_RANGE: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - arg3 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); + arg2 = evaluate_subexp (nullptr, exp, pos, noside); + arg3 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; @@ -10706,14 +10706,14 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, if (exp->elts[*pos].opcode == OP_TYPE) { - evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); - arg1 = NULL; + evaluate_subexp (nullptr, exp, pos, EVAL_SKIP); + arg1 = NULL; type_arg = check_typedef (exp->elts[pc + 2].type); } else { - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - type_arg = NULL; + arg1 = evaluate_subexp (nullptr, exp, pos, noside); + type_arg = NULL; } if (exp->elts[*pos].opcode != OP_LONG) @@ -10843,7 +10843,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, } case OP_ATR_TAG: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; @@ -10854,9 +10854,9 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, case OP_ATR_MIN: case OP_ATR_MAX: - evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + evaluate_subexp (nullptr, exp, pos, EVAL_SKIP); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); + arg2 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; else if (noside == EVAL_AVOID_SIDE_EFFECTS) @@ -10872,8 +10872,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, { struct type *type_arg = check_typedef (exp->elts[pc + 2].type); - evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); - if (noside == EVAL_SKIP) + evaluate_subexp (nullptr, exp, pos, EVAL_SKIP); + if (noside == EVAL_SKIP) goto nosideret; if (!ada_is_modular_type (type_arg)) @@ -10885,8 +10885,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, case OP_ATR_POS: - evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + evaluate_subexp (nullptr, exp, pos, EVAL_SKIP); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; type = builtin_type (exp->gdbarch)->builtin_int; @@ -10896,7 +10896,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, return value_pos_atr (type, arg1); case OP_ATR_SIZE: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); type = value_type (arg1); /* If the argument is a reference, then dereference its type, since @@ -10914,8 +10914,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, TARGET_CHAR_BIT * TYPE_LENGTH (type)); case OP_ATR_VAL: - evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + evaluate_subexp (nullptr, exp, pos, EVAL_SKIP); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); type = exp->elts[pc + 2].type; if (noside == EVAL_SKIP) goto nosideret; @@ -10925,8 +10925,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, return value_val_atr (type, arg1); case BINOP_EXP: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); + arg2 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; else if (noside == EVAL_AVOID_SIDE_EFFECTS) @@ -10944,14 +10944,14 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, } case UNOP_PLUS: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; else return arg1; case UNOP_ABS: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; unop_promote (exp->language_defn, exp->gdbarch, &arg1); @@ -10962,7 +10962,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, case UNOP_IND: preeval_pos = *pos; - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; type = ada_check_typedef (value_type (arg1)); @@ -10991,8 +10991,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, || type->code () == TYPE_CODE_PTR) && ada_is_tagged_type (TYPE_TARGET_TYPE (type), 0)) { - arg1 = evaluate_subexp (NULL_TYPE, exp, &preeval_pos, - EVAL_NORMAL); + arg1 + = evaluate_subexp (nullptr, exp, &preeval_pos, EVAL_NORMAL); type = value_type (ada_value_ind (arg1)); } else @@ -11046,7 +11046,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, tem = longest_to_int (exp->elts[pc + 1].longconst); (*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1); preeval_pos = *pos; - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) goto nosideret; if (noside == EVAL_AVOID_SIDE_EFFECTS) @@ -11065,8 +11065,8 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, if (type == NULL) { - arg1 = evaluate_subexp (NULL_TYPE, exp, &preeval_pos, - EVAL_NORMAL); + arg1 + = evaluate_subexp (nullptr, exp, &preeval_pos, EVAL_NORMAL); arg1 = ada_value_struct_elt (arg1, &exp->elts[pc + 2].string, 0); diff --git a/gdb/eval.c b/gdb/eval.c index c62c35f3183..51b51865f43 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -135,7 +135,7 @@ evaluate_expression (struct expression *exp) { int pc = 0; - return evaluate_subexp (NULL_TYPE, exp, &pc, EVAL_NORMAL); + return evaluate_subexp (nullptr, exp, &pc, EVAL_NORMAL); } /* Evaluate an expression, avoiding all memory references @@ -146,7 +146,7 @@ evaluate_type (struct expression *exp) { int pc = 0; - return evaluate_subexp (NULL_TYPE, exp, &pc, EVAL_AVOID_SIDE_EFFECTS); + return evaluate_subexp (nullptr, exp, &pc, EVAL_AVOID_SIDE_EFFECTS); } /* Evaluate a subexpression, avoiding all memory references and @@ -155,7 +155,7 @@ evaluate_type (struct expression *exp) struct value * evaluate_subexpression_type (struct expression *exp, int subexp) { - return evaluate_subexp (NULL_TYPE, exp, &subexp, EVAL_AVOID_SIDE_EFFECTS); + return evaluate_subexp (nullptr, exp, &subexp, EVAL_AVOID_SIDE_EFFECTS); } /* Find the current value of a watchpoint on EXP. Return the value in @@ -200,7 +200,7 @@ fetch_subexp_value (struct expression *exp, int *pc, struct value **valp, try { - result = evaluate_subexp (NULL_TYPE, exp, pc, EVAL_NORMAL); + result = evaluate_subexp (nullptr, exp, pc, EVAL_NORMAL); } catch (const gdb_exception &ex) { @@ -362,7 +362,7 @@ init_array_element (struct value *array, struct value *element, } else { - index = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside)); + index = value_as_long (evaluate_subexp (nullptr, exp, pos, noside)); if (index < low_bound || index > high_bound) error (_("tuple index out of range")); memcpy (value_contents_raw (array) + (index - low_bound) * element_size, @@ -386,12 +386,12 @@ value_f90_subarray (struct value *array, if (range_type == LOW_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT) low_bound = range->bounds ()->low.const_val (); else - low_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside)); + low_bound = value_as_long (evaluate_subexp (nullptr, exp, pos, noside)); if (range_type == HIGH_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT) high_bound = range->bounds ()->high.const_val (); else - high_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside)); + high_bound = value_as_long (evaluate_subexp (nullptr, exp, pos, noside)); return value_slice (array, low_bound, high_bound - low_bound + 1); } @@ -864,7 +864,7 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos, } else { - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg2 = evaluate_subexp (nullptr, exp, pos, noside); } /* If the function is a virtual function, then the aggregate @@ -872,7 +872,7 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos, the vtable. Otherwise, it is just along for the ride: call the function directly. */ - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); type *a1_type = check_typedef (value_type (arg1)); if (noside == EVAL_SKIP) @@ -941,7 +941,7 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos, } else { - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg2 = evaluate_subexp (nullptr, exp, pos, noside); /* Check to see if the operator '->' has been overloaded. If the operator has been overloaded replace arg2 with the @@ -1243,7 +1243,7 @@ skip_undetermined_arglist (int nargs, struct expression *exp, int *pos, enum noside noside) { for (int i = 0; i < nargs; ++i) - evaluate_subexp (NULL_TYPE, exp, pos, noside); + evaluate_subexp (nullptr, exp, pos, noside); } /* Return true if type is integral or reference to integral */ @@ -1444,9 +1444,9 @@ evaluate_subexp_standard (struct type *expect_type, tem2 = longest_to_int (exp->elts[pc + 1].longconst); tem3 = longest_to_int (exp->elts[pc + 2].longconst); nargs = tem3 - tem2 + 1; - type = expect_type ? check_typedef (expect_type) : NULL_TYPE; + type = expect_type ? check_typedef (expect_type) : nullptr; - if (expect_type != NULL_TYPE && noside != EVAL_SKIP + if (expect_type != nullptr && noside != EVAL_SKIP && type->code () == TYPE_CODE_STRUCT) { struct value *rec = allocate_value (expect_type); @@ -1455,7 +1455,7 @@ evaluate_subexp_standard (struct type *expect_type, return evaluate_struct_tuple (rec, exp, pos, noside, nargs); } - if (expect_type != NULL_TYPE && noside != EVAL_SKIP + if (expect_type != nullptr && noside != EVAL_SKIP && type->code () == TYPE_CODE_ARRAY) { struct type *range_type = type->index_type (); @@ -1503,7 +1503,7 @@ evaluate_subexp_standard (struct type *expect_type, return array; } - if (expect_type != NULL_TYPE && noside != EVAL_SKIP + if (expect_type != nullptr && noside != EVAL_SKIP && type->code () == TYPE_CODE_SET) { struct value *set = allocate_value (expect_type); @@ -1581,11 +1581,10 @@ evaluate_subexp_standard (struct type *expect_type, case TERNOP_SLICE: { - struct value *array = evaluate_subexp (NULL_TYPE, exp, pos, noside); + struct value *array = evaluate_subexp (nullptr, exp, pos, noside); int lowbound - = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside)); - int upper - = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside)); + = value_as_long (evaluate_subexp (nullptr, exp, pos, noside)); + int upper = value_as_long (evaluate_subexp (nullptr, exp, pos, noside)); if (noside == EVAL_SKIP) return eval_skip_value (exp); @@ -1594,16 +1593,16 @@ evaluate_subexp_standard (struct type *expect_type, case TERNOP_COND: /* Skip third and second args to evaluate the first one. */ - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (value_logical_not (arg1)) { - evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); - return evaluate_subexp (NULL_TYPE, exp, pos, noside); + evaluate_subexp (nullptr, exp, pos, EVAL_SKIP); + return evaluate_subexp (nullptr, exp, pos, noside); } else { - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); + arg2 = evaluate_subexp (nullptr, exp, pos, noside); + evaluate_subexp (nullptr, exp, pos, EVAL_SKIP); return arg2; } @@ -1929,7 +1928,7 @@ evaluate_subexp_standard (struct type *expect_type, (*pos) += 2; /* First determine the type code we are dealing with. */ - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); type = check_typedef (value_type (arg1)); code = type->code (); @@ -2023,15 +2022,15 @@ evaluate_subexp_standard (struct type *expect_type, /* We have a complex number, There should be 2 floating point numbers that compose it. */ (*pos) += 2; - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); + arg2 = evaluate_subexp (nullptr, exp, pos, noside); return value_literal_complex (arg1, arg2, exp->elts[pc + 1].type); case STRUCTOP_STRUCT: tem = longest_to_int (exp->elts[pc + 1].longconst); (*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1); - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); arg3 = value_struct_elt (&arg1, NULL, &exp->elts[pc + 2].string, @@ -2043,7 +2042,7 @@ evaluate_subexp_standard (struct type *expect_type, case STRUCTOP_PTR: tem = longest_to_int (exp->elts[pc + 1].longconst); (*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1); - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); @@ -2100,9 +2099,9 @@ evaluate_subexp_standard (struct type *expect_type, if (op == STRUCTOP_MEMBER) arg1 = evaluate_subexp_for_address (exp, pos, noside); else - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg2 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); @@ -2162,14 +2161,15 @@ evaluate_subexp_standard (struct type *expect_type, return value_concat (arg1, arg2); case BINOP_ASSIGN: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); /* Special-case assignments where the left-hand-side is a convenience variable -- in these, don't bother setting an expected type. This avoids a weird case where re-assigning a string or array to an internal variable could error with "Too many array elements". */ arg2 = evaluate_subexp (VALUE_LVAL (arg1) == lval_internalvar - ? NULL_TYPE : value_type (arg1), + ? nullptr + : value_type (arg1), exp, pos, noside); if (noside == EVAL_SKIP || noside == EVAL_AVOID_SIDE_EFFECTS) @@ -2181,7 +2181,7 @@ evaluate_subexp_standard (struct type *expect_type, case BINOP_ASSIGN_MODIFY: (*pos) += 2; - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside); if (noside == EVAL_SKIP || noside == EVAL_AVOID_SIDE_EFFECTS) return arg1; @@ -2265,8 +2265,8 @@ evaluate_subexp_standard (struct type *expect_type, case BINOP_BITWISE_AND: case BINOP_BITWISE_IOR: case BINOP_BITWISE_XOR: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); + arg2 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); if (binop_user_defined_p (op, arg1, arg2)) @@ -2308,8 +2308,8 @@ evaluate_subexp_standard (struct type *expect_type, } case BINOP_SUBSCRIPT: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); + arg2 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); if (binop_user_defined_p (op, arg1, arg2)) @@ -2444,61 +2444,61 @@ evaluate_subexp_standard (struct type *expect_type, } case BINOP_LOGICAL_AND: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) { - evaluate_subexp (NULL_TYPE, exp, pos, noside); + evaluate_subexp (nullptr, exp, pos, noside); return eval_skip_value (exp); } oldpos = *pos; - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS); + arg2 = evaluate_subexp (nullptr, exp, pos, EVAL_AVOID_SIDE_EFFECTS); *pos = oldpos; if (binop_user_defined_p (op, arg1, arg2)) { - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg2 = evaluate_subexp (nullptr, exp, pos, noside); return value_x_binop (arg1, arg2, op, OP_NULL, noside); } else { tem = value_logical_not (arg1); - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, - (tem ? EVAL_SKIP : noside)); + arg2 + = evaluate_subexp (nullptr, exp, pos, (tem ? EVAL_SKIP : noside)); type = language_bool_type (exp->language_defn, exp->gdbarch); return value_from_longest (type, (LONGEST) (!tem && !value_logical_not (arg2))); } case BINOP_LOGICAL_OR: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) { - evaluate_subexp (NULL_TYPE, exp, pos, noside); + evaluate_subexp (nullptr, exp, pos, noside); return eval_skip_value (exp); } oldpos = *pos; - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS); + arg2 = evaluate_subexp (nullptr, exp, pos, EVAL_AVOID_SIDE_EFFECTS); *pos = oldpos; if (binop_user_defined_p (op, arg1, arg2)) { - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg2 = evaluate_subexp (nullptr, exp, pos, noside); return value_x_binop (arg1, arg2, op, OP_NULL, noside); } else { tem = value_logical_not (arg1); - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, - (!tem ? EVAL_SKIP : noside)); + arg2 + = evaluate_subexp (nullptr, exp, pos, (!tem ? EVAL_SKIP : noside)); type = language_bool_type (exp->language_defn, exp->gdbarch); return value_from_longest (type, (LONGEST) (!tem || !value_logical_not (arg2))); } case BINOP_EQUAL: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); @@ -2515,7 +2515,7 @@ evaluate_subexp_standard (struct type *expect_type, } case BINOP_NOTEQUAL: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); @@ -2532,7 +2532,7 @@ evaluate_subexp_standard (struct type *expect_type, } case BINOP_LESS: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); @@ -2549,7 +2549,7 @@ evaluate_subexp_standard (struct type *expect_type, } case BINOP_GTR: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); @@ -2566,7 +2566,7 @@ evaluate_subexp_standard (struct type *expect_type, } case BINOP_GEQ: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); @@ -2583,7 +2583,7 @@ evaluate_subexp_standard (struct type *expect_type, } case BINOP_LEQ: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); @@ -2600,8 +2600,8 @@ evaluate_subexp_standard (struct type *expect_type, } case BINOP_REPEAT: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); + arg2 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); type = check_typedef (value_type (arg2)); @@ -2617,11 +2617,11 @@ evaluate_subexp_standard (struct type *expect_type, return value_repeat (arg1, longest_to_int (value_as_long (arg2))); case BINOP_COMMA: - evaluate_subexp (NULL_TYPE, exp, pos, noside); - return evaluate_subexp (NULL_TYPE, exp, pos, noside); + evaluate_subexp (nullptr, exp, pos, noside); + return evaluate_subexp (nullptr, exp, pos, noside); case UNOP_PLUS: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); if (unop_user_defined_p (op, arg1)) @@ -2633,7 +2633,7 @@ evaluate_subexp_standard (struct type *expect_type, } case UNOP_NEG: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); if (unop_user_defined_p (op, arg1)) @@ -2647,7 +2647,7 @@ evaluate_subexp_standard (struct type *expect_type, case UNOP_COMPLEMENT: /* C++: check for and handle destructor names. */ - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); if (unop_user_defined_p (UNOP_COMPLEMENT, arg1)) @@ -2659,7 +2659,7 @@ evaluate_subexp_standard (struct type *expect_type, } case UNOP_LOGICAL_NOT: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); if (unop_user_defined_p (op, arg1)) @@ -2715,7 +2715,7 @@ evaluate_subexp_standard (struct type *expect_type, if (noside == EVAL_SKIP) { - evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); + evaluate_subexp (nullptr, exp, pos, EVAL_SKIP); return eval_skip_value (exp); } else @@ -2729,15 +2729,15 @@ evaluate_subexp_standard (struct type *expect_type, case UNOP_SIZEOF: if (noside == EVAL_SKIP) { - evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); + evaluate_subexp (nullptr, exp, pos, EVAL_SKIP); return eval_skip_value (exp); } return evaluate_subexp_for_sizeof (exp, pos, noside); case UNOP_ALIGNOF: { - type = value_type (evaluate_subexp (NULL_TYPE, exp, pos, - EVAL_AVOID_SIDE_EFFECTS)); + type = value_type ( + evaluate_subexp (nullptr, exp, pos, EVAL_AVOID_SIDE_EFFECTS)); /* FIXME: This should be size_t. */ struct type *size_type = builtin_type (exp->gdbarch)->builtin_int; ULONGEST align = type_align (type); @@ -2915,7 +2915,7 @@ evaluate_subexp_standard (struct type *expect_type, case OP_DECLTYPE: if (noside == EVAL_SKIP) { - evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); + evaluate_subexp (nullptr, exp, pos, EVAL_SKIP); return eval_skip_value (exp); } else if (noside == EVAL_AVOID_SIDE_EFFECTS) @@ -2923,8 +2923,7 @@ evaluate_subexp_standard (struct type *expect_type, enum exp_opcode sub_op = exp->elts[*pos].opcode; struct value *result; - result = evaluate_subexp (NULL_TYPE, exp, pos, - EVAL_AVOID_SIDE_EFFECTS); + result = evaluate_subexp (nullptr, exp, pos, EVAL_AVOID_SIDE_EFFECTS); /* 'decltype' has special semantics for lvalues. */ if (op == OP_DECLTYPE @@ -2956,10 +2955,9 @@ evaluate_subexp_standard (struct type *expect_type, enum exp_opcode sub_op = exp->elts[*pos].opcode; if (sub_op == OP_TYPE || sub_op == OP_DECLTYPE || sub_op == OP_TYPEOF) - result = evaluate_subexp (NULL_TYPE, exp, pos, - EVAL_AVOID_SIDE_EFFECTS); + result = evaluate_subexp (nullptr, exp, pos, EVAL_AVOID_SIDE_EFFECTS); else - result = evaluate_subexp (NULL_TYPE, exp, pos, noside); + result = evaluate_subexp (nullptr, exp, pos, noside); if (noside != EVAL_NORMAL) return allocate_value (cplus_typeid_type (exp->gdbarch)); @@ -3008,7 +3006,7 @@ evaluate_subexp_for_address (struct expression *exp, int *pos, { case UNOP_IND: (*pos)++; - x = evaluate_subexp (NULL_TYPE, exp, pos, noside); + x = evaluate_subexp (nullptr, exp, pos, noside); /* We can't optimize out "&*" if there's a user-defined operator*. */ if (unop_user_defined_p (op, x)) @@ -3022,17 +3020,17 @@ evaluate_subexp_for_address (struct expression *exp, int *pos, case UNOP_MEMVAL: (*pos) += 3; return value_cast (lookup_pointer_type (exp->elts[pc + 1].type), - evaluate_subexp (NULL_TYPE, exp, pos, noside)); + evaluate_subexp (nullptr, exp, pos, noside)); case UNOP_MEMVAL_TYPE: { struct type *type; (*pos) += 1; - x = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS); + x = evaluate_subexp (nullptr, exp, pos, EVAL_AVOID_SIDE_EFFECTS); type = value_type (x); return value_cast (lookup_pointer_type (type), - evaluate_subexp (NULL_TYPE, exp, pos, noside)); + evaluate_subexp (nullptr, exp, pos, noside)); } case OP_VAR_VALUE: @@ -3089,7 +3087,7 @@ evaluate_subexp_for_address (struct expression *exp, int *pos, default: default_case: - x = evaluate_subexp (NULL_TYPE, exp, pos, noside); + x = evaluate_subexp (nullptr, exp, pos, noside); default_case_after_eval: if (noside == EVAL_AVOID_SIDE_EFFECTS) { @@ -3150,7 +3148,7 @@ evaluate_subexp_with_coercion (struct expression *exp, /* FALLTHROUGH */ default: - return evaluate_subexp (NULL_TYPE, exp, pos, noside); + return evaluate_subexp (nullptr, exp, pos, noside); } } @@ -3182,7 +3180,7 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos, create a value unnecessarily. */ case UNOP_IND: (*pos)++; - val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS); + val = evaluate_subexp (nullptr, exp, pos, EVAL_AVOID_SIDE_EFFECTS); type = check_typedef (value_type (val)); if (type->code () != TYPE_CODE_PTR && !TYPE_IS_REFERENCE (type) @@ -3208,7 +3206,7 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos, type = SYMBOL_TYPE (exp->elts[pc + 2].symbol); if (is_dynamic_type (type)) { - val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_NORMAL); + val = evaluate_subexp (nullptr, exp, pos, EVAL_NORMAL); type = value_type (val); if (type->code () == TYPE_CODE_ARRAY && is_dynamic_type (type->index_type ()) @@ -3245,7 +3243,7 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos, { int npc = (*pos) + 1; - val = evaluate_subexp (NULL_TYPE, exp, &npc, EVAL_AVOID_SIDE_EFFECTS); + val = evaluate_subexp (nullptr, exp, &npc, EVAL_AVOID_SIDE_EFFECTS); type = check_typedef (value_type (val)); if (type->code () == TYPE_CODE_ARRAY) { @@ -3257,7 +3255,7 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos, is a variable length type. */ if (type->bounds ()->flag_bound_evaluated) { - val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_NORMAL); + val = evaluate_subexp (nullptr, exp, pos, EVAL_NORMAL); return value_from_longest (size_type, (LONGEST) TYPE_LENGTH (value_type (val))); } @@ -3268,7 +3266,7 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos, /* Fall through. */ default: - val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS); + val = evaluate_subexp (nullptr, exp, pos, EVAL_AVOID_SIDE_EFFECTS); type = value_type (val); break; } diff --git a/gdb/f-lang.c b/gdb/f-lang.c index 58b41d11d11..54d56f0d781 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -136,7 +136,7 @@ evaluate_subexp_f (struct type *expect_type, struct expression *exp, return evaluate_subexp_standard (expect_type, exp, pos, noside); case UNOP_ABS: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); type = value_type (arg1); @@ -159,7 +159,7 @@ evaluate_subexp_f (struct type *expect_type, struct expression *exp, error (_("ABS of type %s not supported"), TYPE_SAFE_NAME (type)); case BINOP_MOD: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); @@ -193,7 +193,7 @@ evaluate_subexp_f (struct type *expect_type, struct expression *exp, case UNOP_FORTRAN_CEILING: { - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); type = value_type (arg1); @@ -208,7 +208,7 @@ evaluate_subexp_f (struct type *expect_type, struct expression *exp, case UNOP_FORTRAN_FLOOR: { - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); type = value_type (arg1); @@ -223,7 +223,7 @@ evaluate_subexp_f (struct type *expect_type, struct expression *exp, case BINOP_FORTRAN_MODULO: { - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); @@ -260,7 +260,7 @@ evaluate_subexp_f (struct type *expect_type, struct expression *exp, } case BINOP_FORTRAN_CMPLX: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside); if (noside == EVAL_SKIP) return eval_skip_value (exp); diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 55a6dafb7e2..b02f6674bf5 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1148,8 +1148,6 @@ struct type struct main_type *main_type; }; -#define NULL_TYPE ((struct type *) 0) - struct fn_fieldlist { diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c index eccf1df9621..ff2cfd001d1 100644 --- a/gdb/opencl-lang.c +++ b/gdb/opencl-lang.c @@ -739,7 +739,7 @@ evaluate_subexp_opencl (struct type *expect_type, struct expression *exp, scalar-to-vector widening. */ case BINOP_ASSIGN: (*pos)++; - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); type1 = value_type (arg1); arg2 = evaluate_subexp (type1, exp, pos, noside); @@ -784,7 +784,7 @@ evaluate_subexp_opencl (struct type *expect_type, struct expression *exp, case BINOP_GEQ: case BINOP_LEQ: (*pos)++; - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); arg2 = evaluate_subexp (value_type (arg1), exp, pos, noside); if (noside == EVAL_SKIP) @@ -796,7 +796,7 @@ evaluate_subexp_opencl (struct type *expect_type, struct expression *exp, /* Handle the logical unary operator not(!). */ case UNOP_LOGICAL_NOT: (*pos)++; - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) return value_from_longest (builtin_type (exp->gdbarch)-> @@ -808,11 +808,11 @@ evaluate_subexp_opencl (struct type *expect_type, struct expression *exp, case BINOP_LOGICAL_AND: case BINOP_LOGICAL_OR: (*pos)++; - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) { - evaluate_subexp (NULL_TYPE, exp, pos, noside); + evaluate_subexp (nullptr, exp, pos, noside); return value_from_longest (builtin_type (exp->gdbarch)-> builtin_int, 1); @@ -826,8 +826,7 @@ evaluate_subexp_opencl (struct type *expect_type, struct expression *exp, Therefore we evaluate it once using EVAL_AVOID_SIDE_EFFECTS. */ int oldpos = *pos; - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, - EVAL_AVOID_SIDE_EFFECTS); + arg2 = evaluate_subexp (nullptr, exp, pos, EVAL_AVOID_SIDE_EFFECTS); *pos = oldpos; type1 = check_typedef (value_type (arg1)); type2 = check_typedef (value_type (arg2)); @@ -835,7 +834,7 @@ evaluate_subexp_opencl (struct type *expect_type, struct expression *exp, if ((type1->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type1)) || (type2->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type2))) { - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg2 = evaluate_subexp (nullptr, exp, pos, noside); return opencl_relop (exp, arg1, arg2, op); } @@ -850,8 +849,8 @@ evaluate_subexp_opencl (struct type *expect_type, struct expression *exp, if (op == BINOP_LOGICAL_OR) tmp = !tmp; - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, - tmp ? EVAL_SKIP : noside); + arg2 + = evaluate_subexp (nullptr, exp, pos, tmp ? EVAL_SKIP : noside); type1 = language_bool_type (exp->language_defn, exp->gdbarch); if (op == BINOP_LOGICAL_AND) @@ -866,7 +865,7 @@ evaluate_subexp_opencl (struct type *expect_type, struct expression *exp, /* Handle the ternary selection operator. */ case TERNOP_COND: (*pos)++; - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); type1 = check_typedef (value_type (arg1)); if (type1->code () == TYPE_CODE_ARRAY && TYPE_VECTOR (type1)) { @@ -875,8 +874,8 @@ evaluate_subexp_opencl (struct type *expect_type, struct expression *exp, int t2_is_vec, t3_is_vec, i; LONGEST lowb1, lowb2, lowb3, highb1, highb2, highb3; - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - arg3 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg2 = evaluate_subexp (nullptr, exp, pos, noside); + arg3 = evaluate_subexp (nullptr, exp, pos, noside); type2 = check_typedef (value_type (arg2)); type3 = check_typedef (value_type (arg3)); t2_is_vec @@ -942,15 +941,15 @@ Cannot perform conditional operation on vectors with different sizes")); if (value_logical_not (arg1)) { /* Skip the second operand. */ - evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); + evaluate_subexp (nullptr, exp, pos, EVAL_SKIP); - return evaluate_subexp (NULL_TYPE, exp, pos, noside); + return evaluate_subexp (nullptr, exp, pos, noside); } else { /* Skip the third operand. */ - arg2 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - evaluate_subexp (NULL_TYPE, exp, pos, EVAL_SKIP); + arg2 = evaluate_subexp (nullptr, exp, pos, noside); + evaluate_subexp (nullptr, exp, pos, EVAL_SKIP); return arg2; } @@ -963,7 +962,7 @@ Cannot perform conditional operation on vectors with different sizes")); int tem = longest_to_int (exp->elts[pc + 1].longconst); (*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1); - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg1 = evaluate_subexp (nullptr, exp, pos, noside); type1 = check_typedef (value_type (arg1)); if (noside == EVAL_SKIP) diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c index ddd4b57d294..a590f9d6b4e 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c @@ -1014,12 +1014,12 @@ rust_evaluate_funcall (struct expression *exp, int *pos, enum noside noside) /* Evaluate the argument to STRUCTOP_STRUCT, then find its type in order to look up the method. */ - arg0 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + arg0 = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) { for (i = 0; i < num_args; ++i) - evaluate_subexp (NULL_TYPE, exp, pos, noside); + evaluate_subexp (nullptr, exp, pos, noside); return arg0; } @@ -1056,7 +1056,7 @@ rust_evaluate_funcall (struct expression *exp, int *pos, enum noside noside) function = address_of_variable (sym.symbol, block); for (i = 0; i < num_args; ++i) - args[i + 1] = evaluate_subexp (NULL_TYPE, exp, pos, noside); + args[i + 1] = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_AVOID_SIDE_EFFECTS) result = value_zero (TYPE_TARGET_TYPE (fn_type), not_lval); @@ -1084,10 +1084,10 @@ rust_range (struct expression *exp, int *pos, enum noside noside) if (kind == HIGH_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT_EXCLUSIVE) - low = evaluate_subexp (NULL_TYPE, exp, pos, noside); + low = evaluate_subexp (nullptr, exp, pos, noside); if (kind == LOW_BOUND_DEFAULT || kind == LOW_BOUND_DEFAULT_EXCLUSIVE || kind == NONE_BOUND_DEFAULT || kind == NONE_BOUND_DEFAULT_EXCLUSIVE) - high = evaluate_subexp (NULL_TYPE, exp, pos, noside); + high = evaluate_subexp (nullptr, exp, pos, noside); bool inclusive = (kind == NONE_BOUND_DEFAULT || kind == LOW_BOUND_DEFAULT); if (noside == EVAL_SKIP) @@ -1216,8 +1216,8 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside, int want_slice = 0; ++*pos; - lhs = evaluate_subexp (NULL_TYPE, exp, pos, noside); - rhs = evaluate_subexp (NULL_TYPE, exp, pos, noside); + lhs = evaluate_subexp (nullptr, exp, pos, noside); + rhs = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) return lhs; @@ -1396,7 +1396,7 @@ rust_evaluate_subexp (struct type *expect_type, struct expression *exp, struct value *value; ++*pos; - value = evaluate_subexp (NULL_TYPE, exp, pos, noside); + value = evaluate_subexp (nullptr, exp, pos, noside); if (noside == EVAL_SKIP) { /* Preserving the type is enough. */ @@ -1527,9 +1527,9 @@ rust_evaluate_subexp (struct type *expect_type, struct expression *exp, pc = (*pos)++; field_number = longest_to_int (exp->elts[pc + 1].longconst); (*pos) += 2; - lhs = evaluate_subexp (NULL_TYPE, exp, pos, noside); + lhs = evaluate_subexp (nullptr, exp, pos, noside); - type = value_type (lhs); + type = value_type (lhs); if (type->code () == TYPE_CODE_STRUCT) { @@ -1599,7 +1599,7 @@ tuple structs, and tuple-like enum variants")); pc = (*pos)++; tem = longest_to_int (exp->elts[pc + 1].longconst); (*pos) += 3 + BYTES_TO_EXP_ELEM (tem + 1); - lhs = evaluate_subexp (NULL_TYPE, exp, pos, noside); + lhs = evaluate_subexp (nullptr, exp, pos, noside); const char *field_name = &exp->elts[pc + 2].string; type = value_type (lhs);