diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-05 21:34:24 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-05 21:34:24 +0000 |
commit | 2e171de466a2cfb7fe037aa11fb8803a93ad1916 (patch) | |
tree | 186673f49214bc2f410d4f333b9304a4f4c451c7 /gcc/cp/lex.c | |
parent | 72214ac9ad7c4d3c189f0bd2327f3f3d3987533a (diff) | |
download | gcc-2e171de466a2cfb7fe037aa11fb8803a93ad1916.tar.gz |
2009-07-05 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r149262
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@149264 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/lex.c')
-rw-r--r-- | gcc/cp/lex.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index bf507411d6f..5eb182d3caf 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -532,19 +532,22 @@ retrofit_lang_decl (tree t) { struct lang_decl *ld; size_t size; - - if (CAN_HAVE_FULL_LANG_DECL_P (t)) - size = sizeof (struct lang_decl); + int sel; + + if (TREE_CODE (t) == FUNCTION_DECL) + sel = 1, size = sizeof (struct lang_decl_fn); + else if (TREE_CODE (t) == NAMESPACE_DECL) + sel = 2, size = sizeof (struct lang_decl_ns); + else if (TREE_CODE (t) == PARM_DECL) + sel = 3, size = sizeof (struct lang_decl_parm); + else if (LANG_DECL_HAS_MIN (t)) + sel = 0, size = sizeof (struct lang_decl_min); else - size = sizeof (struct lang_decl_flags); + gcc_unreachable (); ld = GGC_CNEWVAR (struct lang_decl, size); - ld->decl_flags.can_be_full = CAN_HAVE_FULL_LANG_DECL_P (t) ? 1 : 0; - ld->decl_flags.u1sel = TREE_CODE (t) == NAMESPACE_DECL ? 1 : 0; - ld->decl_flags.u2sel = 0; - if (ld->decl_flags.can_be_full) - ld->u.f.u3sel = TREE_CODE (t) == FUNCTION_DECL ? 1 : 0; + ld->u.base.selector = sel; DECL_LANG_SPECIFIC (t) = ld; if (current_lang_name == lang_name_cplusplus @@ -572,10 +575,17 @@ cxx_dup_lang_specific_decl (tree node) if (! DECL_LANG_SPECIFIC (node)) return; - if (!CAN_HAVE_FULL_LANG_DECL_P (node)) - size = sizeof (struct lang_decl_flags); + if (TREE_CODE (node) == FUNCTION_DECL) + size = sizeof (struct lang_decl_fn); + else if (TREE_CODE (node) == NAMESPACE_DECL) + size = sizeof (struct lang_decl_ns); + else if (TREE_CODE (node) == PARM_DECL) + size = sizeof (struct lang_decl_parm); + else if (LANG_DECL_HAS_MIN (node)) + size = sizeof (struct lang_decl_min); else - size = sizeof (struct lang_decl); + gcc_unreachable (); + ld = GGC_NEWVAR (struct lang_decl, size); memcpy (ld, DECL_LANG_SPECIFIC (node), size); DECL_LANG_SPECIFIC (node) = ld; |