#include "ggc.h"
#include "langhooks.h"
#include "langhooks-def.h"
+#include "diagnostic.h"
+#include "c-pretty-print.h"
+
+static void c_initialize_diagnostics (diagnostic_context *);
enum c_language_kind c_language = clk_c;
#define LANG_HOOKS_FINISH c_common_finish
#undef LANG_HOOKS_INIT_OPTIONS
#define LANG_HOOKS_INIT_OPTIONS c_common_init_options
+#undef LANG_HOOKS_INITIALIZE_DIAGNOSTICS
+#define LANG_HOOKS_INITIALIZE_DIAGNOSTICS c_initialize_diagnostics
#undef LANG_HOOKS_HANDLE_OPTION
#define LANG_HOOKS_HANDLE_OPTION c_common_handle_option
#undef LANG_HOOKS_MISSING_ARGUMENT
#define LANG_HOOKS_PARSE_FILE c_common_parse_file
#undef LANG_HOOKS_TRUTHVALUE_CONVERSION
#define LANG_HOOKS_TRUTHVALUE_CONVERSION c_common_truthvalue_conversion
-#undef LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES
-#define LANG_HOOKS_INSERT_DEFAULT_ATTRIBUTES c_insert_default_attributes
#undef LANG_HOOKS_FINISH_INCOMPLETE_DECL
#define LANG_HOOKS_FINISH_INCOMPLETE_DECL c_finish_incomplete_decl
#undef LANG_HOOKS_UNSAFE_FOR_REEVAL
#define LANG_HOOKS_FUNCTION_LEAVE_NESTED c_pop_function_context
#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL c_dup_lang_specific_decl
+#undef LANG_HOOKS_DECL_UNINIT
+#define LANG_HOOKS_DECL_UNINIT c_decl_uninit
+
+#undef LANG_HOOKS_RTL_EXPAND_STMT
+#define LANG_HOOKS_RTL_EXPAND_STMT expand_stmt
/* Attribute hooks. */
#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR c_incomplete_type_error
#undef LANG_HOOKS_TYPE_PROMOTES_TO
#define LANG_HOOKS_TYPE_PROMOTES_TO c_type_promotes_to
+#undef LANG_HOOKS_REGISTER_BUILTIN_TYPE
+#define LANG_HOOKS_REGISTER_BUILTIN_TYPE c_register_builtin_type
#undef LANG_HOOKS_WRITE_GLOBALS
#define LANG_HOOKS_WRITE_GLOBALS c_write_global_declarations
};
#undef DEFTREECODE
-/* Used by c-lex.c, but only for objc. */
-
-tree
-lookup_interface (tree arg ATTRIBUTE_UNUSED)
-{
- return 0;
-}
-
-tree
-is_class_name (tree arg ATTRIBUTE_UNUSED)
-{
- return 0;
-}
-
-tree
-objc_is_id (tree arg ATTRIBUTE_UNUSED)
-{
- return 0;
-}
-
void
-objc_check_decl (tree decl ATTRIBUTE_UNUSED)
-{
-}
-
-int
-objc_comptypes (tree lhs ATTRIBUTE_UNUSED, tree rhs ATTRIBUTE_UNUSED,
- int reflexive ATTRIBUTE_UNUSED)
-{
- return -1;
-}
-
-tree
-objc_message_selector (void)
-{
- return 0;
-}
-
-/* Used by c-typeck.c (build_external_ref), but only for objc. */
-
-tree
-lookup_objc_ivar (tree id ATTRIBUTE_UNUSED)
+finish_file (void)
{
- return 0;
+ c_objc_common_finish_file ();
}
-void
-finish_file (void)
+static void
+c_initialize_diagnostics (diagnostic_context *context)
{
- c_objc_common_finish_file ();
+ pretty_printer *base = context->printer;
+ c_pretty_printer *pp = xmalloc (sizeof (c_pretty_printer));
+ memcpy (pp_base (pp), base, sizeof (pretty_printer));
+ pp_c_pretty_printer_init (pp);
+ context->printer = (pretty_printer *) pp;
+
+ /* It is safe to free this object because it was previously malloc()'d. */
+ free (base);
}
#include "gtype-c.h"