#include "hard-reg-set.h"
#include "flags.h"
-#ifndef SUPPORTS_ONE_ONLY
-#define SUPPORTS_ONE_ONLY 0
-#endif
-
/* TREE_LIST of the current inline functions that need to be
processed. */
struct pending_inline *pending_inlines;
# define OB_FINISH() (obstack_1grow (&scratch_obstack, '\0'))
# define OB_LAST() (obstack_next_free (&scratch_obstack)[-1])
-#ifdef NO_AUTO_OVERLOAD
-int is_overloaded ();
-#endif
-
void
init_method ()
{
\f
/* Report an argument type mismatch between the best declared function
we could find and the current argument list that we have. */
+
void
report_type_mismatch (cp, parmtypes, name_kind)
struct candidate *cp;
} while (0)
/* Code to concatenate an asciified integer to a string. */
+
static
#ifdef __GNUC__
__inline
build_overload_identifier (decl);
}
-/* Encoding for an INTEGER_CST value. */
+/* Encoding for an INTEGER_CST value. */
+
static void
build_overload_int (value)
tree value;
OB_PUTC ('_');
return;
}
- else if (current_template_parms
+ else if (processing_template_decl
&& TREE_CODE (value) != INTEGER_CST)
/* We don't ever want this output, but it's inconvenient not to
be able to build the string. This should cause assembler
}
my_friendly_assert (TREE_CODE (value) == INTEGER_CST, 243);
- if (TYPE_PRECISION (value) == 2 * HOST_BITS_PER_WIDE_INT)
+ if (TYPE_PRECISION (TREE_TYPE (value)) == 2 * HOST_BITS_PER_WIDE_INT)
{
if (tree_int_cst_lt (value, integer_zero_node))
{
{
if (TREE_CODE (value) == CONSTRUCTOR)
{
- /* This is dangerous code, crack built up pointer to members. */
+ /* This is dangerous code, crack built up pointer to members. */
tree args = CONSTRUCTOR_ELTS (value);
tree a1 = TREE_VALUE (args);
tree a2 = TREE_VALUE (TREE_CHAIN (args));
if (TREE_USED (parmtype))
{
+#if 0
+ /* We can turn this on at some point when we want
+ improved symbol mangling. */
+ nrepeats++;
+#else
+ /* This is bug compatible with 2.7.x */
flush_repeats (parmtype);
+#endif
goto next;
}
{
tree context = name;
- /* If DECL_ASSEMBLER_NAME has been set properly, use it. */
+ /* If DECL_ASSEMBLER_NAME has been set properly, use it. */
if (DECL_ASSEMBLER_NAME (context) != DECL_NAME (context))
{
OB_PUTID (DECL_ASSEMBLER_NAME (context));
if (nrepeats)
flush_repeats (typevec[maxtype-1]);
- /* To get here, parms must end with `...'. */
+ /* To get here, parms must end with `...'. */
OB_PUTC ('e');
}
FOR_METHOD is 1 if this overload is being performed
for a method, rather than a function type. It is 2 if
this overload is being performed for a constructor. */
+
tree
build_decl_overload (dname, parms, for_method)
tree dname;
}
/* Build an overload name for the type expression TYPE. */
+
tree
build_typename_overload (type)
tree type;
OB_FINISH ();
return get_identifier (obstack_base (&scratch_obstack));
}
-
-/* Top-level interface to explicit overload requests. Allow NAME
- to be overloaded. Error if NAME is already declared for the current
- scope. Warning if function is redundantly overloaded. */
-
-void
-declare_overloaded (name)
- tree name;
-{
-#ifdef NO_AUTO_OVERLOAD
- if (is_overloaded (name))
- warning ("function `%s' already declared overloaded",
- IDENTIFIER_POINTER (name));
- else if (IDENTIFIER_GLOBAL_VALUE (name))
- error ("overloading function `%s' that is already defined",
- IDENTIFIER_POINTER (name));
- else
- {
- TREE_OVERLOADED (name) = 1;
- IDENTIFIER_GLOBAL_VALUE (name) = build_tree_list (name, NULL_TREE);
- TREE_TYPE (IDENTIFIER_GLOBAL_VALUE (name)) = unknown_type_node;
- }
-#else
- if (current_lang_name == lang_name_cplusplus)
- {
- if (0)
- warning ("functions are implicitly overloaded in C++");
- }
- else if (current_lang_name == lang_name_c)
- error ("overloading function `%s' cannot be done in C language context");
- else
- my_friendly_abort (76);
-#endif
-}
-
-#ifdef NO_AUTO_OVERLOAD
-/* Check to see if NAME is overloaded. For first approximation,
- check to see if its TREE_OVERLOADED is set. This is used on
- IDENTIFIER nodes. */
-int
-is_overloaded (name)
- tree name;
-{
- /* @@ */
- return (TREE_OVERLOADED (name)
- && (! IDENTIFIER_CLASS_VALUE (name) || current_class_type == 0)
- && ! IDENTIFIER_LOCAL_VALUE (name));
-}
-#endif
\f
/* Given a tree_code CODE, and some arguments (at least one),
attempt to use an overloaded operator on the arguments.
int try_second;
int binary_is_unary;
+ if (flag_ansi_overloading)
+ return build_new_op (code, flags, xarg1, xarg2, arg3);
+
if (xarg1 == error_mark_node)
return error_mark_node;
if (TREE_CODE (TREE_TYPE (arg1)) == ARRAY_TYPE)
{
- /* Strip off the pointer and the array. */
+ /* Strip off the pointer and the array. */
arg1 = TREE_TYPE (TREE_TYPE (arg1));
while (TREE_CODE (arg1) == ARRAY_TYPE)
/* Try to fail. First, fail if unary */
if (! try_second)
return rval;
- /* Second, see if second argument is non-aggregate. */
+ /* Second, see if second argument is non-aggregate. */
type2 = TREE_TYPE (xarg2);
if (TREE_CODE (type2) == OFFSET_TYPE)
type2 = TREE_TYPE (type2);
/* There's probably a LOT of code in the world that
relies upon this old behavior. */
- if (! flag_traditional)
- pedwarn ("no `operator%s (int)' declared for postfix `%s', using prefix operator instead",
- op, op);
+ pedwarn ("no `operator%s (int)' declared for postfix `%s', using prefix operator instead",
+ op, op);
xarg2 = NULL_TREE;
binary_is_unary = 1;
}
return value;
}
- if (TREE_CODE (type) == REFERENCE_TYPE && ! current_template_parms)
+ if (TREE_CODE (type) == REFERENCE_TYPE && ! processing_template_decl)
value = convert_from_reference (value);
return value;
}
TREE_READONLY (thunk) = TYPE_READONLY (TREE_TYPE (vtable_entry_type));
TREE_THIS_VOLATILE (thunk) = TYPE_VOLATILE (TREE_TYPE (vtable_entry_type));
make_function_rtl (thunk);
+ comdat_linkage (thunk);
TREE_SET_CODE (thunk, THUNK_DECL);
DECL_INITIAL (thunk) = function;
THUNK_DELTA (thunk) = delta;
DECL_EXTERNAL (thunk) = 1;
-#ifdef DECL_ONE_ONLY
- if (SUPPORTS_ONE_ONLY)
- {
- DECL_ONE_ONLY (thunk) = 1;
- TREE_PUBLIC (thunk) = 1;
- }
- else
-#endif
- TREE_PUBLIC (thunk) = 0;
/* So that finish_file can write out any thunks that need to be: */
pushdecl_top_level (thunk);
}
int failure = 0;
int save_ofp;
- /* Used to remember which regs we need to emit a USE rtx for. */
+ /* Used to remember which regs we need to emit a USE rtx for. */
rtx need_use[FIRST_PSEUDO_REGISTER];
int need_use_count = 0;
- /* rtx for the 'this' parameter. */
+ /* rtx for the 'this' parameter. */
rtx this_rtx = 0, this_reg_rtx = 0, fixed_this_rtx;
char *(*save_decl_printable_name) () = decl_printable_name;
if (current_function_decl)
abort ();
current_function_decl = thunk_fndecl;
+
+ TREE_SET_CODE (thunk_fndecl, FUNCTION_DECL);
#ifdef ASM_OUTPUT_MI_THUNK
temporary_allocation ();
assemble_start_function (thunk_fndecl, fnname);
/* Now look through all the parameters, make sure that we
don't clobber any registers used for parameters.
- Also, pick up an rtx for the first "this" parameter. */
+ Also, pick up an rtx for the first "this" parameter. */
for (argp = TYPE_ARG_TYPES (TREE_TYPE (function));
argp != NULL_TREE;
argp = TREE_CHAIN (argp))
permanent_allocation (1);
flag_omit_frame_pointer = save_ofp;
#endif /* ASM_OUTPUT_MI_THUNK */
+ TREE_SET_CODE (thunk_fndecl, THUNK_DECL);
decl_printable_name = save_decl_printable_name;
current_function_decl = 0;
/* For the anonymous union in TYPE, return the member that is at least as
large as the rest of the members, so we can copy it. */
+
static tree
largest_union_member (type)
tree type;
}
/* Generate code for default X(X&) constructor. */
+
void
do_build_copy_constructor (fndecl)
tree fndecl;
tree context = hack_decl_function_context (fndecl);
tree base = DECL_CLASS_CONTEXT (fndecl);
- if (nested)
+ if (! context)
+ push_to_top_level ();
+ else if (nested)
push_cp_function_context (context);
interface_unknown = 1;
- start_function (NULL_TREE, fndecl, NULL_TREE, NULL_TREE, 1);
+ start_function (NULL_TREE, fndecl, NULL_TREE, 1);
store_parm_decls ();
if (DECL_NAME (fndecl) == ansi_opname[MODIFY_EXPR])
/* Turn off DECL_INLINE for the moment so function_cannot_inline_p
will check our size. */
DECL_INLINE (fndecl) = 0;
- if (function_cannot_inline_p (fndecl) == 0)
+
+ /* We say !at_eof because at the end of the file some of the rtl
+ for fndecl may have been allocated on the temporary obstack.
+ (The function_obstack is the temporary one if we're not in a
+ function). */
+ if ((! at_eof) && function_cannot_inline_p (fndecl) == 0)
DECL_INLINE (fndecl) = 1;
}
extract_interface_info ();
- if (nested)
+ if (! context)
+ pop_from_top_level ();
+ else if (nested)
pop_cp_function_context (context);
}