View | Details | Return to bug 2316 | Differences between
and this patch

Collapse All | Expand All

(-)gcc/tree.c (-1 / +11 lines)
Lines 7521-7527 Link Here
7521
   If such a type has already been constructed, reuse it.  */
7521
   If such a type has already been constructed, reuse it.  */
7522
7522
7523
tree
7523
tree
7524
build_function_type (tree value_type, tree arg_types)
7524
build_function_type2 (tree value_type, tree arg_types, int extern_c)
7525
{
7525
{
7526
  tree t;
7526
  tree t;
7527
  hashval_t hashcode = 0;
7527
  hashval_t hashcode = 0;
Lines 7538-7547 Link Here
7538
  t = make_node (FUNCTION_TYPE);
7538
  t = make_node (FUNCTION_TYPE);
7539
  TREE_TYPE (t) = value_type;
7539
  TREE_TYPE (t) = value_type;
7540
  TYPE_ARG_TYPES (t) = arg_types;
7540
  TYPE_ARG_TYPES (t) = arg_types;
7541
  if(extern_c)
7542
  {
7543
    TYPE_MINVAL (t) = integer_one_node;
7544
  }
7541
7545
7542
  /* If we already have such a type, use the old one.  */
7546
  /* If we already have such a type, use the old one.  */
7543
  hashcode = iterative_hash_object (TYPE_HASH (value_type), hashcode);
7547
  hashcode = iterative_hash_object (TYPE_HASH (value_type), hashcode);
7544
  hashcode = type_hash_list (arg_types, hashcode);
7548
  hashcode = type_hash_list (arg_types, hashcode);
7549
  hashcode = iterative_hash_object (extern_c, hashcode);
7545
  t = type_hash_canon (hashcode, t);
7550
  t = type_hash_canon (hashcode, t);
7546
7551
7547
  /* Set up the canonical type. */
7552
  /* Set up the canonical type. */
Lines 7560-7565 Link Here
7560
    layout_type (t);
7565
    layout_type (t);
7561
  return t;
7566
  return t;
7562
}
7567
}
7568
tree
7569
build_function_type (tree value_type, tree arg_types)
7570
{
7571
  return build_function_type2 (value_type, arg_types, 0);
7572
}
7563
7573
7564
/* Build variant of function type ORIG_TYPE skipping ARGS_TO_SKIP.  */
7574
/* Build variant of function type ORIG_TYPE skipping ARGS_TO_SKIP.  */
7565
7575
(-)gcc/tree.h (+1 lines)
Lines 4337-4342 Link Here
4337
extern tree build_nonshared_array_type (tree, tree);
4337
extern tree build_nonshared_array_type (tree, tree);
4338
extern tree build_array_type_nelts (tree, unsigned HOST_WIDE_INT);
4338
extern tree build_array_type_nelts (tree, unsigned HOST_WIDE_INT);
4339
extern tree build_function_type (tree, tree);
4339
extern tree build_function_type (tree, tree);
4340
extern tree build_function_type2 (tree, tree, int);
4340
extern tree build_function_type_list (tree, ...);
4341
extern tree build_function_type_list (tree, ...);
4341
extern tree build_function_type_skip_args (tree, bitmap);
4342
extern tree build_function_type_skip_args (tree, bitmap);
4342
extern tree build_function_decl_skip_args (tree, bitmap);
4343
extern tree build_function_decl_skip_args (tree, bitmap);
(-)gcc/cp/typeck.c (+2 lines)
Lines 1281-1286 Link Here
1281
	return false;
1281
	return false;
1282
      if (!compparms (TYPE_ARG_TYPES (t1), TYPE_ARG_TYPES (t2)))
1282
      if (!compparms (TYPE_ARG_TYPES (t1), TYPE_ARG_TYPES (t2)))
1283
	return false;
1283
	return false;
1284
      if (TYPE_MINVAL (t1) != TYPE_MINVAL (t2))
1285
	return false;
1284
      break;
1286
      break;
1285
1287
1286
    case ARRAY_TYPE:
1288
    case ARRAY_TYPE:
(-)gcc/cp/decl.c (-1 / +1 lines)
Lines 9177-9183 Link Here
9177
		parms = NULL_TREE;
9177
		parms = NULL_TREE;
9178
	      }
9178
	      }
9179
9179
9180
	    type = build_function_type (type, arg_types);
9180
	    type = build_function_type2 (type, arg_types, current_lang_name == lang_name_c);
9181
	  }
9181
	  }
9182
	  break;
9182
	  break;
9183
9183
(-)gcc/cp/mangle.c (+2 lines)
Lines 2264-2269 Link Here
2264
    }
2264
    }
2265
2265
2266
  write_char ('F');
2266
  write_char ('F');
2267
  if(TYPE_MINVAL (type))
2268
    write_char ('Y');
2267
  /* We don't track whether or not a type is `extern "C"'.  Note that
2269
  /* We don't track whether or not a type is `extern "C"'.  Note that
2268
     you can have an `extern "C"' function that does not have
2270
     you can have an `extern "C"' function that does not have
2269
     `extern "C"' type, and vice versa:
2271
     `extern "C"' type, and vice versa:

Return to bug 2316