/* Handle the hair of processing (but not expanding) inline functions.
Also manage function and variable name overloading.
Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
+ Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com)
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA. */
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
/* Handle method declarations. */
#include "target.h"
#include "tree-pass.h"
#include "diagnostic.h"
+#include "cgraph.h"
/* Various flags to control the mangling process. */
current_function_decl = thunk_fndecl;
DECL_RESULT (thunk_fndecl)
= build_decl (RESULT_DECL, 0, integer_type_node);
- fnname = XSTR (XEXP (DECL_RTL (thunk_fndecl), 0), 0);
+ fnname = IDENTIFIER_POINTER (DECL_NAME (thunk_fndecl));
/* The back end expects DECL_INITIAL to contain a BLOCK, so we
create one. */
fn_block = make_node (BLOCK);
BLOCK_VARS (fn_block) = a;
DECL_INITIAL (thunk_fndecl) = fn_block;
init_function_start (thunk_fndecl);
- current_function_is_thunk = 1;
+ crtl->is_thunk = 1;
assemble_start_function (thunk_fndecl, fnname);
targetm.asm_out.output_mi_thunk (asm_out_file, thunk_fndecl,
assemble_end_function (thunk_fndecl, fnname);
init_insn_lengths ();
current_function_decl = 0;
- cfun = 0;
+ set_cfun (NULL);
TREE_ASM_WRITTEN (thunk_fndecl) = 1;
}
else
argarray[i] = a;
t = build_call_a (alias, i, argarray);
CALL_FROM_THUNK_P (t) = 1;
+ CALL_CANNOT_INLINE_P (t) = 1;
if (VOID_TYPE_P (TREE_TYPE (t)))
finish_expr_stmt (t);
t = build3 (COND_EXPR, TREE_TYPE (t), cond, t,
cp_convert (TREE_TYPE (t), integer_zero_node));
}
- if (IS_AGGR_TYPE (TREE_TYPE (t)))
+ if (MAYBE_CLASS_TYPE_P (TREE_TYPE (t)))
t = build_cplus_new (TREE_TYPE (t), t);
finish_return_stmt (t);
}
pop_deferring_access_checks ();
thunk_fndecl = finish_function (0);
- tree_lowering_passes (thunk_fndecl);
- expand_body (thunk_fndecl);
+ cgraph_add_new_function (thunk_fndecl, false);
}
pop_from_top_level ();
build_tree_list (NULL_TREE,
converted_parm),
base_binfo,
- LOOKUP_NORMAL | LOOKUP_NONVIRTUAL));
+ LOOKUP_NORMAL | LOOKUP_NONVIRTUAL,
+ tf_warning_or_error));
}
/* Assign to each of the non-static data members. */
init = build3 (COMPONENT_REF, expr_type, init, field, NULL_TREE);
if (DECL_NAME (field))
- init = build_modify_expr (comp, NOP_EXPR, init);
+ init = cp_build_modify_expr (comp, NOP_EXPR, init,
+ tf_warning_or_error);
else
init = build2 (MODIFY_EXPR, TREE_TYPE (comp), comp, init);
finish_expr_stmt (init);
if (! context)
push_to_top_level ();
else if (nested)
- push_function_context_to (context);
+ push_function_context ();
input_location = DECL_SOURCE_LOCATION (fndecl);
if (! context)
pop_from_top_level ();
else if (nested)
- pop_function_context_from (context);
+ pop_function_context ();
pop_deferring_access_checks ();
DECL_ASSIGNMENT_OPERATOR_P (fn) = 1;
SET_OVERLOADED_OPERATOR_CODE (fn, NOP_EXPR);
}
+
+ /* If pointers to member functions use the least significant bit to
+ indicate whether a function is virtual, ensure a pointer
+ to this function will have that bit clear. */
+ if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn
+ && DECL_ALIGN (fn) < 2 * BITS_PER_UNIT)
+ DECL_ALIGN (fn) = 2 * BITS_PER_UNIT;
+
/* Create the explicit arguments. */
if (rhs_parm_type)
{
as there are artificial parms in FN. */
tree
-skip_artificial_parms_for (tree fn, tree list)
+skip_artificial_parms_for (const_tree fn, tree list)
{
if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn))
list = TREE_CHAIN (list);
artificial parms in FN. */
int
-num_artificial_parms_for (tree fn)
+num_artificial_parms_for (const_tree fn)
{
int count = 0;