}
/* Add the appropriate elements for a minimal symbol to the end of
- the expression. */
+ the expression. The rationale behind passing in text_symbol_type and
+ data_symbol_type was so that Modula-2 could pass in WORD for
+ data_symbol_type. Perhaps it still is useful to have those types vary
+ based on the language, but they no longer have names like "int", so
+ the initial rationale is gone. */
+
+static struct type *msym_text_symbol_type;
+static struct type *msym_data_symbol_type;
+static struct type *msym_unknown_symbol_type;
void
write_exp_msymbol (msymbol, text_symbol_type, data_symbol_type)
case mst_text:
case mst_file_text:
case mst_solib_trampoline:
- write_exp_elt_type (text_symbol_type);
+ write_exp_elt_type (msym_text_symbol_type);
break;
case mst_data:
case mst_file_data:
case mst_bss:
case mst_file_bss:
- write_exp_elt_type (data_symbol_type);
+ write_exp_elt_type (msym_data_symbol_type);
break;
default:
- write_exp_elt_type (builtin_type_char);
+ write_exp_elt_type (msym_unknown_symbol_type);
break;
}
write_exp_elt_opcode (UNOP_MEMVAL);
oplen = 3;
break;
- case OP_F77_LITERAL_COMPLEX:
- oplen = 1;
- args = 2;
- break;
-
- case OP_F77_SUBSTR:
+ case OP_COMPLEX:
oplen = 1;
args = 2;
break;
args = 1;
break;
+ case OP_LABELED:
case STRUCTOP_STRUCT:
case STRUCTOP_PTR:
args = 1;
break;
case TERNOP_COND:
+ case TERNOP_SLICE:
+ case TERNOP_SLICE_COUNT:
args = 3;
break;
/* Modula-2 */
case MULTI_SUBSCRIPT:
- /* Fortran */
- case MULTI_F77_SUBSCRIPT:
oplen = 3;
args = 1 + longest_to_int (expr->elts[endpos- 2].longconst);
break;
oplen = 3;
break;
- case OP_F77_LITERAL_COMPLEX:
- oplen = 1;
- args = 2;
- break;
-
- case OP_F77_SUBSTR:
+ case OP_COMPLEX:
oplen = 1;
args = 2;
break;
case STRUCTOP_STRUCT:
case STRUCTOP_PTR:
+ case OP_LABELED:
args = 1;
/* fall through */
case OP_M2_STRING:
break;
case TERNOP_COND:
+ case TERNOP_SLICE:
+ case TERNOP_SLICE_COUNT:
args = 3;
break;
/* Modula-2 */
case MULTI_SUBSCRIPT:
- /* Fortran */
- case MULTI_F77_SUBSCRIPT:
oplen = 3;
args = 1 + longest_to_int (inexpr->elts[inend - 2].longconst);
break;
break;
case tp_array:
array_size = pop_type_int ();
- if (array_size != -1)
- {
- range_type =
- create_range_type ((struct type *) NULL,
- builtin_type_int, 0,
- array_size - 1);
- follow_type =
- create_array_type ((struct type *) NULL,
- follow_type, range_type);
- }
- else
- follow_type = lookup_pointer_type (follow_type);
+ /* FIXME-type-allocation: need a way to free this type when we are
+ done with it. */
+ range_type =
+ create_range_type ((struct type *) NULL,
+ builtin_type_int, 0,
+ array_size >= 0 ? array_size - 1 : 0);
+ follow_type =
+ create_array_type ((struct type *) NULL,
+ follow_type, range_type);
+ if (array_size < 0)
+ TYPE_ARRAY_UPPER_BOUND_TYPE(follow_type)
+ = BOUND_CANNOT_BE_DETERMINED;
break;
case tp_function:
+ /* FIXME-type-allocation: need a way to free this type when we are
+ done with it. */
follow_type = lookup_function_type (follow_type);
break;
}
type_stack_depth = 0;
type_stack = (union type_stack_elt *)
xmalloc (type_stack_size * sizeof (*type_stack));
+
+ msym_text_symbol_type =
+ init_type (TYPE_CODE_FUNC, 1, 0, "<text variable, no debug info>", NULL);
+ TYPE_TARGET_TYPE (msym_text_symbol_type) = builtin_type_int;
+ msym_data_symbol_type =
+ init_type (TYPE_CODE_INT, TARGET_INT_BIT / HOST_CHAR_BIT, 0,
+ "<data variable, no debug info>", NULL);
+ msym_unknown_symbol_type =
+ init_type (TYPE_CODE_INT, 1, 0,
+ "<variable (not text or data), no debug info>",
+ NULL);
}