/* Some code common to C++ and ObjC++ front ends.
- Copyright (C) 2004 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2007 Free Software Foundation, Inc.
Contributed by Ziemowit Laski <zlaski@apple.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) any later
+Software Foundation; either version 3, or (at your option) any later
version.
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
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/>. */
#include "config.h"
#include "system.h"
/* Special routine to get the alias set for C++. */
-HOST_WIDE_INT
+alias_set_type
cxx_get_alias_set (tree t)
{
if (IS_FAKE_BASE_TYPE (t))
return get_alias_set (TYPE_CONTEXT (t));
/* Punt on PMFs until we canonicalize functions properly. */
- if (TYPE_PTRMEMFUNC_P (t))
+ if (TYPE_PTRMEMFUNC_P (t)
+ || (POINTER_TYPE_P (t)
+ && TYPE_PTRMEMFUNC_P (TREE_TYPE (t))))
return 0;
return c_common_get_alias_set (t);
/* Called from check_global_declarations. */
bool
-cxx_warn_unused_global_decl (tree decl)
+cxx_warn_unused_global_decl (const_tree decl)
{
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl))
return false;
might have allocated something there. */
tree
-cp_expr_size (tree exp)
+cp_expr_size (const_tree exp)
{
tree type = TREE_TYPE (exp);
{
switch (code)
{
- case TINST_LEVEL: return sizeof (struct tinst_level_s);
case PTRMEM_CST: return sizeof (struct ptrmem_cst);
case BASELINK: return sizeof (struct tree_baselink);
case TEMPLATE_PARM_INDEX: return sizeof (template_parm_index);
return 0;
}
+tree
+cxx_staticp (tree arg)
+{
+ switch (TREE_CODE (arg))
+ {
+ case BASELINK:
+ return staticp (BASELINK_FUNCTIONS (arg));
+
+ default:
+ break;
+ }
+
+ return NULL_TREE;
+}
+
/* Stubs to keep c-opts.c happy. */
void
push_file_scope (void)
/* c-pragma.c needs to query whether a decl has extern "C" linkage. */
bool
-has_c_linkage (tree decl)
+has_c_linkage (const_tree decl)
{
return DECL_EXTERN_C_P (decl);
}