Skip to content

Commit

Permalink
gdb: remove NULL_TYPE
Browse files Browse the repository at this point in the history
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
  • Loading branch information
simark committed Aug 31, 2020
1 parent 06de2e0 commit fe1fe7e
Show file tree
Hide file tree
Showing 7 changed files with 169 additions and 170 deletions.
4 changes: 4 additions & 0 deletions gdb/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2020-08-31 Simon Marchi <[email protected]>

* gdbtypes.h (NULL_TYPE): Remove, change all uses to nullptr.

2020-08-29 Pedro Alves <[email protected]>

* progspace.c (print_program_space): Use all_inferiors. Switch to
Expand Down
96 changes: 48 additions & 48 deletions gdb/ada-lang.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand All @@ -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;
Expand All @@ -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)))
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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)
Expand Down Expand Up @@ -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;

Expand All @@ -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)
Expand All @@ -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))
Expand All @@ -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;
Expand All @@ -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
Expand All @@ -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;
Expand All @@ -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)
Expand All @@ -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);
Expand All @@ -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));
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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);
Expand Down
Loading

0 comments on commit fe1fe7e

Please sign in to comment.