#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 ()
{
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_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;
}
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;
-#ifdef NEW_OVER
- return build_new_op (code, flags, xarg1, xarg2, arg3);
-#endif
+ if (flag_ansi_overloading)
+ return build_new_op (code, flags, xarg1, xarg2, arg3);
if (xarg1 == error_mark_node)
return error_mark_node;
/* 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);
}
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])
}
extract_interface_info ();
- if (nested)
+ if (! context)
+ pop_from_top_level ();
+ else if (nested)
pop_cp_function_context (context);
}