/* Language-specific hook definitions for CHILL front end.
- Copyright (C) 1992, 93, 1994, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
This file is part of GNU CC.
#include "lex.h"
#include "input.h"
#include "toplev.h"
+#include "rtl.h"
+#include "expr.h"
+#include "diagnostic.h"
/* Type node for boolean types. */
int special_UC = 0;
/* The actual name of the input file, regardless of any #line directives */
-char* chill_real_input_filename;
+const char* chill_real_input_filename;
extern FILE* finput;
-extern int maximum_field_alignment;
+static int deep_const_expr PARAMS ((tree));
+static void chill_print_error_function PARAMS ((diagnostic_context *,
+ const char *));
\f
-/* return 1 if the expression tree given has all
- constant nodes as its leaves; return 0 otherwise. */
-int
+/* Return 1 if the expression tree given has all
+ constant nodes as its leaves,otherwise. */
+
+static int
deep_const_expr (exp)
tree exp;
{
return 0;
code = TREE_CODE (exp);
- length = tree_code_length[(int) code];
+ length = first_rtl_op (TREE_CODE (exp));
/* constant leaf? return TRUE */
if (TREE_CODE_CLASS (code) == 'c')
return 1;
- /* recursively check next level down */
+ /* Recursively check next level down. */
for (i = 0; i < length; i++)
if (! deep_const_expr (TREE_OPERAND (exp, i)))
return 0;
int indent ATTRIBUTE_UNUSED;
{
}
-
-void
-GNU_xref_begin ()
-{
- fatal ("GCC does not yet support XREF");
-}
-
-void
-GNU_xref_end ()
-{
- fatal ("GCC does not yet support XREF");
-}
\f
/*
* process chill-specific compiler command-line options
+ * do not complain if the option is not recognised
*/
int
lang_decode_option (argc, argv)
explicit_ignore_case = 1;
if (special_UC)
{
- error ("Ignoring case upon input and");
- error ("making special words uppercase wouldn't work.");
+ error ("ignoring case upon input and");
+ error ("making special words uppercase wouldn't work");
}
else
ignore_case = 1;
{
if (explicit_ignore_case)
{
- error ("Making special words uppercase and");
- error (" ignoring case upon input wouldn't work.");
+ error ("making special words uppercase and");
+ error (" ignoring case upon input wouldn't work");
}
else
special_UC = 1, ignore_case = 0;
return 1;
}
-void
-chill_print_error_function (file)
- char *file;
+static void
+chill_print_error_function (context, file)
+ diagnostic_context *buffer __attribute__((__unused__));
+ const char *file;
{
static tree last_error_function = NULL_TREE;
static struct module *last_error_module = NULL;
}
else
{
- char *kind = "function";
- char *name = (*decl_printable_name) (current_function_decl, 2);
+ const char *kind = "function";
+ const char *name = (*decl_printable_name) (current_function_decl, 2);
fprintf (stderr, "In %s `%s':\n", kind, name);
}
}
error ("internal error - use of undefined type");
}
+/* Return the typed-based alias set for T, which may be an expression
+ or a type. Return -1 if we don't do anything special. */
+
+HOST_WIDE_INT
+lang_get_alias_set (t)
+ tree t ATTRIBUTE_UNUSED;
+{
+ /* ??? Need to figure out what the rules are. Certainly we'd need
+ to handle union-like things, and probably variant records.
+ Until then, turn off type-based aliasing completely. */
+ return 0;
+}
+
void
lang_init ()
{
- extern void (*print_error_function) PROTO((char*));
-
chill_real_input_filename = input_filename;
/* the beginning of the file is a new line; check for # */