{
case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE:
case POINTER_TYPE: case REFERENCE_TYPE:
- case OFFSET_TYPE:
+ case OFFSET_TYPE: case NULLPTR_TYPE:
return build_int_cst (type, 0);
case REAL_TYPE:
case METHOD_TYPE:
case FUNCTION_TYPE:
case VECTOR_TYPE:
+ case NULLPTR_TYPE:
return false;
case INTEGER_TYPE:
free_lang_data_in_one_sizepos (&TYPE_SIZE (type));
free_lang_data_in_one_sizepos (&TYPE_SIZE_UNIT (type));
- if (debug_info_level < DINFO_LEVEL_TERSE
- || (TYPE_CONTEXT (type)
- && TREE_CODE (TYPE_CONTEXT (type)) != FUNCTION_DECL
- && TREE_CODE (TYPE_CONTEXT (type)) != NAMESPACE_DECL))
- TYPE_CONTEXT (type) = NULL_TREE;
+ if (TYPE_CONTEXT (type)
+ && TREE_CODE (TYPE_CONTEXT (type)) == BLOCK)
+ {
+ tree ctx = TYPE_CONTEXT (type);
+ do
+ {
+ ctx = BLOCK_SUPERCONTEXT (ctx);
+ }
+ while (ctx && TREE_CODE (ctx) == BLOCK);
+ TYPE_CONTEXT (type) = ctx;
+ }
}
fld_worklist_push (TYPE_MAIN_VARIANT (t), fld);
/* Do not walk TYPE_NEXT_VARIANT. We do not stream it and thus
do not and want not to reach unused variants this way. */
- fld_worklist_push (TYPE_CONTEXT (t), fld);
+ if (TYPE_CONTEXT (t))
+ {
+ tree ctx = TYPE_CONTEXT (t);
+ /* We adjust BLOCK TYPE_CONTEXTs to the innermost non-BLOCK one.
+ So push that instead. */
+ while (ctx && TREE_CODE (ctx) == BLOCK)
+ ctx = BLOCK_SUPERCONTEXT (ctx);
+ fld_worklist_push (ctx, fld);
+ }
/* Do not walk TYPE_CANONICAL. We do not stream it and thus do not
and want not to reach unused types this way. */
case COMPLEX_TYPE:
case POINTER_TYPE:
case REFERENCE_TYPE:
+ case NULLPTR_TYPE:
return 1;
case VECTOR_TYPE: