/* Language-dependent hooks for C++.
- Copyright 2001, 2002 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2004 Free Software Foundation, Inc.
Contributed by Alexandre Oliva <aoliva@redhat.com>
This file is part of GCC.
#define LANG_HOOKS_WRITE_GLOBALS lhd_do_nothing
#undef LANG_HOOKS_DECL_UNINIT
#define LANG_HOOKS_DECL_UNINIT c_decl_uninit
+#undef LANG_HOOKS_UPDATE_DECL_AFTER_SAVING
+#define LANG_HOOKS_UPDATE_DECL_AFTER_SAVING cp_update_decl_after_saving
#undef LANG_HOOKS_FUNCTION_INIT
#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P anon_aggr_type_p
#undef LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P
#define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P cp_var_mod_type_p
-#undef LANG_HOOKS_TREE_INLINING_START_INLINING
-#define LANG_HOOKS_TREE_INLINING_START_INLINING cp_start_inlining
-#undef LANG_HOOKS_TREE_INLINING_END_INLINING
-#define LANG_HOOKS_TREE_INLINING_END_INLINING cp_end_inlining
#undef LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS
#define LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS c_estimate_num_insns
#undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN
static HOST_WIDE_INT
cxx_get_alias_set (tree t)
{
+ if (IS_FAKE_BASE_TYPE (t))
+ /* The base variant of a type must be in the same alias set as the
+ complete type. */
+ return get_alias_set (TYPE_CONTEXT (t));
if (/* It's not yet safe to use alias sets for some classes in C++. */
!ok_to_generate_alias_set_for_type (t)
abort ();
/* This would be wrong for a type with virtual bases, but they are
caught by the abort above. */
- return CLASSTYPE_SIZE_UNIT (TREE_TYPE (exp));
+ return (is_empty_class (TREE_TYPE (exp))
+ ? size_zero_node
+ : CLASSTYPE_SIZE_UNIT (TREE_TYPE (exp)));
}
else
/* Use the default code. */
case TEMPLATE_PARM_INDEX: return sizeof (template_parm_index);
case DEFAULT_ARG: return sizeof (struct tree_default_arg);
case OVERLOAD: return sizeof (struct tree_overload);
- case WRAPPER: return sizeof (struct tree_wrapper);
default:
abort ();
}
return false;
}
-/* Stub routine to tell people that this doesn't work yet. */
-void
-c_reset_state (void)
-{
- sorry ("inter-module optimisations not implemented yet");
-}
-
/* Construct a C++-aware pretty-printer for CONTEXT. It is assumed
that CONTEXT->printer is an already constructed basic pretty_printer. */
static void
/* It is safe to free this object because it was previously malloc()'d. */
free (base);
}
+
+/* Stubs to keep c-opts.c happy. */
+void
+push_file_scope (void)
+{
+}
+
+void
+pop_file_scope (void)
+{
+}