cp-lang.c (shadowed_var_for_decl, [...]): Move over to cp-objcp-common.c.
2005-07-09 Andrew Pinski <pinskia@physics.uc.edu> * cp-lang.c (shadowed_var_for_decl, decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Move over to cp-objcp-common.c. (cp_init_ts): Call init_shadowed_var_for_decl. Remove include of gt-cp-cp-lang.h. * cp-objcp-common.c (shadowed_var_for_decl, decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Moved from cp-lang.c. (init_shadowed_var_for_decl): New function to initialize shadowed_var_for_decl. Include gt-cp-cp-objcp-common.h. * Make-lang.in (gt-cp-lang.h): Remove. (gt-cp-cp-objcp-common.h): Add. (cp/cp-lang.o): Remove dependancy on gt-cp-lang.h. (cp/cp-objcp-common.o): Add dependancy on gt-cp-cp-objcp-common.h. * config-lang.in (gtfiles): Remove cp-lang.c and Add cp-objcp-common.c. * cp-tree (init_shadowed_var_for_decl): Add prototype. 2005-07-09 Andrew Pinski <pinskia@physics.uc.edu> * config-lang.in (gtfiles): Add cp-objcp-common.c. * objcp-lang.c (objcxx_init_ts): New function. (LANG_HOOKS_INIT_TS): Define. From-SVN: r101830
This commit is contained in:
parent
999a06a0da
commit
3ed8593d45
|
@ -1,3 +1,22 @@
|
|||
2005-07-09 Andrew Pinski <pinskia@physics.uc.edu>
|
||||
|
||||
* cp-lang.c (shadowed_var_for_decl, decl_shadowed_for_var_lookup,
|
||||
decl_shadowed_for_var_insert): Move over to cp-objcp-common.c.
|
||||
(cp_init_ts): Call init_shadowed_var_for_decl.
|
||||
Remove include of gt-cp-cp-lang.h.
|
||||
* cp-objcp-common.c (shadowed_var_for_decl,
|
||||
decl_shadowed_for_var_lookup, decl_shadowed_for_var_insert): Moved from
|
||||
cp-lang.c.
|
||||
(init_shadowed_var_for_decl): New function to initialize
|
||||
shadowed_var_for_decl.
|
||||
Include gt-cp-cp-objcp-common.h.
|
||||
* Make-lang.in (gt-cp-lang.h): Remove.
|
||||
(gt-cp-cp-objcp-common.h): Add.
|
||||
(cp/cp-lang.o): Remove dependancy on gt-cp-lang.h.
|
||||
(cp/cp-objcp-common.o): Add dependancy on gt-cp-cp-objcp-common.h.
|
||||
* config-lang.in (gtfiles): Remove cp-lang.c and Add cp-objcp-common.c.
|
||||
* cp-tree (init_shadowed_var_for_decl): Add prototype.
|
||||
|
||||
2005-07-08 Daniel Berlin <dberlin@dberlin.org>
|
||||
|
||||
* Make-lang.in: Add gt-cp-lang.h.
|
||||
|
|
|
@ -110,9 +110,9 @@ $(srcdir)/cp/cfns.h: $(srcdir)/cp/cfns.gperf
|
|||
$(srcdir)/cp/cfns.gperf > $(srcdir)/cp/cfns.h
|
||||
|
||||
gtype-cp.h gt-cp-call.h gt-cp-decl.h gt-cp-decl2.h : s-gtype; @true
|
||||
gt-cp-pt.h gt-cp-repo.h gt-cp-parser.h gt-cp-method.h gt-cp-lang.h : s-gtype; @true
|
||||
gt-cp-pt.h gt-cp-repo.h gt-cp-parser.h gt-cp-method.h : s-gtype; @true
|
||||
gt-cp-tree.h gt-cp-mangle.h gt-cp-name-lookup.h gt-cp-typeck2.h: s-gtype; @true
|
||||
gt-cp-rtti.h: s-gtype ; @true
|
||||
gt-cp-rtti.h gt-cp-cp-objcp-common.h: s-gtype ; @true
|
||||
|
||||
#
|
||||
# Build hooks:
|
||||
|
@ -237,7 +237,7 @@ cp/lex.o: cp/lex.c $(CXX_TREE_H) $(TM_H) flags.h \
|
|||
c-pragma.h toplev.h output.h input.h cp/operators.def $(TM_P_H)
|
||||
cp/cp-lang.o: cp/cp-lang.c $(CXX_TREE_H) $(TM_H) toplev.h debug.h langhooks.h \
|
||||
$(LANGHOOKS_DEF_H) c-common.h gtype-cp.h \
|
||||
$(DIAGNOSTIC_H) cp/cp-objcp-common.h gt-cp-lang.h
|
||||
$(DIAGNOSTIC_H) cp/cp-objcp-common.h
|
||||
cp/decl.o: cp/decl.c $(CXX_TREE_H) $(TM_H) flags.h cp/decl.h \
|
||||
output.h $(EXPR_H) except.h toplev.h $(HASHTAB_H) $(RTL_H) \
|
||||
cp/operators.def $(TM_P_H) tree-inline.h diagnostic.h c-pragma.h \
|
||||
|
@ -248,7 +248,7 @@ cp/decl2.o: cp/decl2.c $(CXX_TREE_H) $(TM_H) flags.h cp/decl.h $(EXPR_H) \
|
|||
cp/cp-objcp-common.o : cp/cp-objcp-common.c $(CONFIG_H) $(SYSTEM_H) \
|
||||
coretypes.h $(TM_H) $(TREE_H) $(CXX_TREE_H) c-common.h toplev.h langhooks.h \
|
||||
$(LANGHOOKS_DEF_H) $(DIAGNOSTIC_H) debug.h $(CXX_PRETTY_PRINT_H) \
|
||||
cp/cp-objcp-common.h
|
||||
cp/cp-objcp-common.h gt-cp-cp-objcp-common.h
|
||||
cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h output.h \
|
||||
$(TM_P_H) diagnostic.h gt-cp-typeck2.h
|
||||
cp/typeck.o: cp/typeck.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) $(EXPR_H) \
|
||||
|
|
|
@ -34,4 +34,4 @@ stagestuff="g++\$(exeext) g++-cross\$(exeext) cc1plus\$(exeext)"
|
|||
|
||||
target_libs="target-libstdc++-v3"
|
||||
|
||||
gtfiles="\$(srcdir)/cp/rtti.c \$(srcdir)/cp/mangle.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/parser.c \$(srcdir)/cp/method.c \$(srcdir)/cp/typeck2.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-lex.c \$(srcdir)/c-pragma.c \$(srcdir)/cp/class.c \$(srcdir)/cp/cp-lang.c"
|
||||
gtfiles="\$(srcdir)/cp/rtti.c \$(srcdir)/cp/mangle.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/parser.c \$(srcdir)/cp/method.c \$(srcdir)/cp/typeck2.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-lex.c \$(srcdir)/c-pragma.c \$(srcdir)/cp/class.c \$(srcdir)/cp/cp-objcp-common.c"
|
||||
|
|
|
@ -110,9 +110,6 @@ objcp_tsubst_copy_and_build (tree t ATTRIBUTE_UNUSED,
|
|||
return NULL_TREE;
|
||||
}
|
||||
|
||||
static GTY ((if_marked ("tree_map_marked_p"), param_is (struct tree_map)))
|
||||
htab_t shadowed_var_for_decl;
|
||||
|
||||
|
||||
static void
|
||||
cp_init_ts (void)
|
||||
|
@ -142,47 +139,14 @@ cp_init_ts (void)
|
|||
tree_contains_struct[TEMPLATE_DECL][TS_DECL_MINIMAL] = 1;
|
||||
tree_contains_struct[ALIAS_DECL][TS_DECL_MINIMAL] = 1;
|
||||
|
||||
shadowed_var_for_decl = htab_create_ggc (512, tree_map_hash,
|
||||
tree_map_eq, 0);
|
||||
init_shadowed_var_for_decl ();
|
||||
|
||||
}
|
||||
|
||||
/* Lookup a shadowed var for FROM, and return it if we find one. */
|
||||
|
||||
tree
|
||||
decl_shadowed_for_var_lookup (tree from)
|
||||
{
|
||||
struct tree_map *h, in;
|
||||
in.from = from;
|
||||
|
||||
h = htab_find_with_hash (shadowed_var_for_decl, &in,
|
||||
htab_hash_pointer (from));
|
||||
if (h)
|
||||
return h->to;
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Insert a mapping FROM->TO in the shadowed var hashtable. */
|
||||
|
||||
void
|
||||
decl_shadowed_for_var_insert (tree from, tree to)
|
||||
{
|
||||
struct tree_map *h;
|
||||
void **loc;
|
||||
|
||||
h = ggc_alloc (sizeof (struct tree_map));
|
||||
h->hash = htab_hash_pointer (from);
|
||||
h->from = from;
|
||||
h->to = to;
|
||||
loc = htab_find_slot_with_hash (shadowed_var_for_decl, h, h->hash, INSERT);
|
||||
*(struct tree_map **) loc = h;
|
||||
}
|
||||
|
||||
void
|
||||
finish_file (void)
|
||||
{
|
||||
cp_finish_file ();
|
||||
}
|
||||
|
||||
#include "gt-cp-cp-lang.h"
|
||||
#include "gtype-cp.h"
|
||||
|
|
|
@ -202,3 +202,47 @@ has_c_linkage (tree decl)
|
|||
{
|
||||
return DECL_EXTERN_C_P (decl);
|
||||
}
|
||||
|
||||
static GTY ((if_marked ("tree_map_marked_p"), param_is (struct tree_map)))
|
||||
htab_t shadowed_var_for_decl;
|
||||
|
||||
/* Lookup a shadowed var for FROM, and return it if we find one. */
|
||||
|
||||
tree
|
||||
decl_shadowed_for_var_lookup (tree from)
|
||||
{
|
||||
struct tree_map *h, in;
|
||||
in.from = from;
|
||||
|
||||
h = htab_find_with_hash (shadowed_var_for_decl, &in,
|
||||
htab_hash_pointer (from));
|
||||
if (h)
|
||||
return h->to;
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Insert a mapping FROM->TO in the shadowed var hashtable. */
|
||||
|
||||
void
|
||||
decl_shadowed_for_var_insert (tree from, tree to)
|
||||
{
|
||||
struct tree_map *h;
|
||||
void **loc;
|
||||
|
||||
h = ggc_alloc (sizeof (struct tree_map));
|
||||
h->hash = htab_hash_pointer (from);
|
||||
h->from = from;
|
||||
h->to = to;
|
||||
loc = htab_find_slot_with_hash (shadowed_var_for_decl, h, h->hash, INSERT);
|
||||
*(struct tree_map **) loc = h;
|
||||
}
|
||||
|
||||
void
|
||||
init_shadowed_var_for_decl (void)
|
||||
{
|
||||
shadowed_var_for_decl = htab_create_ggc (512, tree_map_hash,
|
||||
tree_map_eq, 0);
|
||||
}
|
||||
|
||||
|
||||
#include "gt-cp-cp-objcp-common.h"
|
||||
|
|
|
@ -4365,6 +4365,7 @@ extern size_t cp_tree_size (enum tree_code);
|
|||
extern bool cp_var_mod_type_p (tree, tree);
|
||||
extern void cxx_initialize_diagnostics (struct diagnostic_context *);
|
||||
extern int cxx_types_compatible_p (tree, tree);
|
||||
extern void init_shadowed_var_for_decl (void);
|
||||
|
||||
/* in cp-gimplify.c */
|
||||
extern int cp_gimplify_expr (tree *, tree *, tree *);
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
2005-07-09 Andrew Pinski <pinskia@physics.uc.edu>
|
||||
|
||||
* config-lang.in (gtfiles): Add cp-objcp-common.c.
|
||||
* objcp-lang.c (objcxx_init_ts): New function.
|
||||
(LANG_HOOKS_INIT_TS): Define.
|
||||
|
||||
2005-07-03 Kazu Hirata <kazu@codesourcery.com>
|
||||
|
||||
* Make-lang.in (cc1plus-checksum.c): Use
|
||||
|
|
|
@ -40,4 +40,4 @@ build_by_default="no"
|
|||
# libobjc).
|
||||
lang_requires="objc c++"
|
||||
|
||||
gtfiles="\$(srcdir)/objcp/objcp-decl.c \$(srcdir)/objc/objc-act.c \$(srcdir)/objc/objc-act.h \$(srcdir)/cp/rtti.c \$(srcdir)/cp/mangle.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/parser.c \$(srcdir)/cp/method.c \$(srcdir)/cp/typeck2.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-lex.c \$(srcdir)/c-pragma.c"
|
||||
gtfiles="\$(srcdir)/objcp/objcp-decl.c \$(srcdir)/objc/objc-act.c \$(srcdir)/objc/objc-act.h \$(srcdir)/cp/rtti.c \$(srcdir)/cp/mangle.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/parser.c \$(srcdir)/cp/method.c \$(srcdir)/cp/typeck2.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-lex.c \$(srcdir)/c-pragma.c \$(srcdir)/cp/cp-objcp-common.c"
|
||||
|
|
|
@ -35,6 +35,7 @@ Boston, MA 02110-1301, USA. */
|
|||
#include "cp-objcp-common.h"
|
||||
|
||||
enum c_language_kind c_language = clk_objcxx;
|
||||
static void objcxx_init_ts (void);
|
||||
|
||||
/* Lang hooks common to C++ and ObjC++ are declared in cp/cp-objcp-common.h;
|
||||
consequently, there should be very few hooks below. */
|
||||
|
@ -49,6 +50,9 @@ enum c_language_kind c_language = clk_objcxx;
|
|||
#define LANG_HOOKS_GIMPLIFY_EXPR objc_gimplify_expr
|
||||
#undef LANG_HOOKS_GET_CALLEE_FNDECL
|
||||
#define LANG_HOOKS_GET_CALLEE_FNDECL objc_get_callee_fndecl
|
||||
#undef LANG_HOOKS_INIT_TS
|
||||
#define LANG_HOOKS_INIT_TS objcxx_init_ts
|
||||
|
||||
/* Each front end provides its own lang hook initializer. */
|
||||
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
|
||||
|
||||
|
@ -133,6 +137,60 @@ objcp_tsubst_copy_and_build (tree t, tree args, tsubst_flags_t complain,
|
|||
#undef RECURSE
|
||||
}
|
||||
|
||||
static void
|
||||
objcxx_init_ts (void)
|
||||
{
|
||||
/* objc decls */
|
||||
tree_contains_struct[CLASS_METHOD_DECL][TS_DECL_NON_COMMON] = 1;
|
||||
tree_contains_struct[INSTANCE_METHOD_DECL][TS_DECL_NON_COMMON] = 1;
|
||||
tree_contains_struct[KEYWORD_DECL][TS_DECL_NON_COMMON] = 1;
|
||||
|
||||
tree_contains_struct[CLASS_METHOD_DECL][TS_DECL_WITH_VIS] = 1;
|
||||
tree_contains_struct[INSTANCE_METHOD_DECL][TS_DECL_WITH_VIS] = 1;
|
||||
tree_contains_struct[KEYWORD_DECL][TS_DECL_WITH_VIS] = 1;
|
||||
|
||||
tree_contains_struct[CLASS_METHOD_DECL][TS_DECL_WRTL] = 1;
|
||||
tree_contains_struct[INSTANCE_METHOD_DECL][TS_DECL_WRTL] = 1;
|
||||
tree_contains_struct[KEYWORD_DECL][TS_DECL_WRTL] = 1;
|
||||
|
||||
tree_contains_struct[CLASS_METHOD_DECL][TS_DECL_MINIMAL] = 1;
|
||||
tree_contains_struct[INSTANCE_METHOD_DECL][TS_DECL_MINIMAL] = 1;
|
||||
tree_contains_struct[KEYWORD_DECL][TS_DECL_MINIMAL] = 1;
|
||||
|
||||
tree_contains_struct[CLASS_METHOD_DECL][TS_DECL_COMMON] = 1;
|
||||
tree_contains_struct[INSTANCE_METHOD_DECL][TS_DECL_COMMON] = 1;
|
||||
tree_contains_struct[KEYWORD_DECL][TS_DECL_COMMON] = 1;
|
||||
|
||||
/* C++ decls */
|
||||
tree_contains_struct[NAMESPACE_DECL][TS_DECL_NON_COMMON] = 1;
|
||||
tree_contains_struct[USING_DECL][TS_DECL_NON_COMMON] = 1;
|
||||
tree_contains_struct[TEMPLATE_DECL][TS_DECL_NON_COMMON] = 1;
|
||||
tree_contains_struct[ALIAS_DECL][TS_DECL_NON_COMMON] = 1;
|
||||
|
||||
tree_contains_struct[NAMESPACE_DECL][TS_DECL_WITH_VIS] = 1;
|
||||
tree_contains_struct[USING_DECL][TS_DECL_WITH_VIS] = 1;
|
||||
tree_contains_struct[TEMPLATE_DECL][TS_DECL_WITH_VIS] = 1;
|
||||
tree_contains_struct[ALIAS_DECL][TS_DECL_WITH_VIS] = 1;
|
||||
|
||||
tree_contains_struct[NAMESPACE_DECL][TS_DECL_WRTL] = 1;
|
||||
tree_contains_struct[USING_DECL][TS_DECL_WRTL] = 1;
|
||||
tree_contains_struct[TEMPLATE_DECL][TS_DECL_WRTL] = 1;
|
||||
tree_contains_struct[ALIAS_DECL][TS_DECL_WRTL] = 1;
|
||||
|
||||
tree_contains_struct[NAMESPACE_DECL][TS_DECL_COMMON] = 1;
|
||||
tree_contains_struct[USING_DECL][TS_DECL_COMMON] = 1;
|
||||
tree_contains_struct[TEMPLATE_DECL][TS_DECL_COMMON] = 1;
|
||||
tree_contains_struct[ALIAS_DECL][TS_DECL_COMMON] = 1;
|
||||
|
||||
tree_contains_struct[NAMESPACE_DECL][TS_DECL_MINIMAL] = 1;
|
||||
tree_contains_struct[USING_DECL][TS_DECL_MINIMAL] = 1;
|
||||
tree_contains_struct[TEMPLATE_DECL][TS_DECL_MINIMAL] = 1;
|
||||
tree_contains_struct[ALIAS_DECL][TS_DECL_MINIMAL] = 1;
|
||||
|
||||
init_shadowed_var_for_decl ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
finish_file (void)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue