/* Language-specific hook definitions for CHILL front end.
- Copyright (C) 1992, 93, 1994 Free Software Foundation, Inc.
+ Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000, 2001
+ Free Software Foundation, Inc.
This file is part of GNU CC.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
#include "config.h"
+#include "system.h"
#include "tree.h"
#include "ch-tree.h"
#include "lex.h"
-#include <stdio.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;
-
-extern void error PROTO((char *, ...));
-extern void error_with_decl PROTO((tree, char *, ...));
-extern void fatal PROTO((char *, ...));
-extern int floor_log2_wide PROTO((unsigned HOST_WIDE_INT));
-extern void pedwarn_with_decl PROTO((tree, char *, ...));
-extern void sorry PROTO((char *, ...));
-extern int type_hash_list PROTO((tree));
+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;
/* Used by c-lex.c, but only for objc. */
tree
lookup_interface (arg)
- tree arg;
+ tree arg ATTRIBUTE_UNUSED;
{
return 0;
}
int
maybe_objc_comptypes (lhs, rhs)
- tree lhs, rhs;
+ tree lhs ATTRIBUTE_UNUSED, rhs ATTRIBUTE_UNUSED;
{
return -1;
}
void
lang_print_xnode (file, node, indent)
- FILE *file;
- tree node;
- int indent;
-{
-}
-
-void
-GNU_xref_begin ()
-{
- fatal ("GCC does not yet support XREF");
-}
-
-void
-GNU_xref_end ()
+ FILE *file ATTRIBUTE_UNUSED;
+ tree node ATTRIBUTE_UNUSED;
+ int indent ATTRIBUTE_UNUSED;
{
- 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)
char **argv;
{
char *p = argv[0];
- static explicit_ignore_case = 0;
+ static int explicit_ignore_case = 0;
if (!strcmp(p, "-lang-chill"))
; /* do nothing */
else if (!strcmp (p, "-fruntime-checking"))
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);
}
}
void
incomplete_type_error (value, type)
- tree value;
- tree type;
+ tree value ATTRIBUTE_UNUSED;
+ tree type ATTRIBUTE_UNUSED;
{
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 # */