diff options
author | Jason Merrill <jason@redhat.com> | 2012-10-11 11:13:36 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2012-10-11 11:13:36 -0400 |
commit | 21a092a900f1e8515324d6adba05be05cf743b63 (patch) | |
tree | b03ba0e88937ce59f40498c130b441845e844a80 /gcc | |
parent | bc569aa142537b208eafb6a6c935f32cc380e4b4 (diff) | |
download | gcc-21a092a900f1e8515324d6adba05be05cf743b63.zip gcc-21a092a900f1e8515324d6adba05be05cf743b63.tar.gz gcc-21a092a900f1e8515324d6adba05be05cf743b63.tar.bz2 |
cp-tree.h (DECL_THUNKS): NULL_TREE for non-virtual functions.
* cp-tree.h (DECL_THUNKS): NULL_TREE for non-virtual functions.
(SET_DECL_THUNKS): New.
* decl.c (duplicate_decls): Adjust.
* method.c (make_thunk): Adjust.
From-SVN: r192368
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 2 | ||||
-rw-r--r-- | gcc/cp/method.c | 5 |
4 files changed, 14 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index eadfb6e..549ddbd 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2012-10-11 Jason Merrill <jason@redhat.com> + * cp-tree.h (DECL_THUNKS): NULL_TREE for non-virtual functions. + (SET_DECL_THUNKS): New. + * decl.c (duplicate_decls): Adjust. + * method.c (make_thunk): Adjust. + * decl.c (grokdeclarator): Set DECL_GNU_TLS_P for static data members, too. diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 35819ed..fdf122f 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -2378,7 +2378,11 @@ struct GTY((variable_size)) lang_decl { /* The thunks associated with NODE, a FUNCTION_DECL. */ #define DECL_THUNKS(NODE) \ - (LANG_DECL_FN_CHECK (NODE)->context) + (DECL_VIRTUAL_P (NODE) ? LANG_DECL_FN_CHECK (NODE)->context : NULL_TREE) + +/* Set DECL_THUNKS. */ +#define SET_DECL_THUNKS(NODE,THUNKS) \ + (LANG_DECL_FN_CHECK (NODE)->context = (THUNKS)) /* Nonzero if NODE is a thunk, rather than an ordinary function. */ #define DECL_THUNK_P(NODE) \ diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index e78c664..f97f7b1 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -2052,7 +2052,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) /* DECL_THUNKS is only valid for virtual functions, otherwise it is a DECL_FRIEND_CONTEXT. */ if (DECL_VIRTUAL_P (newdecl)) - DECL_THUNKS (newdecl) = DECL_THUNKS (olddecl); + SET_DECL_THUNKS (newdecl, DECL_THUNKS (olddecl)); } /* Only variables have this field. */ else if (TREE_CODE (newdecl) == VAR_DECL diff --git a/gcc/cp/method.c b/gcc/cp/method.c index a42ed60..4d44c7d 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -126,7 +126,8 @@ make_thunk (tree function, bool this_adjusting, FUNCTION_DECL, NULL_TREE, TREE_TYPE (function)); DECL_LANG_SPECIFIC (thunk) = DECL_LANG_SPECIFIC (function); cxx_dup_lang_specific_decl (thunk); - DECL_THUNKS (thunk) = NULL_TREE; + DECL_VIRTUAL_P (thunk) = true; + SET_DECL_THUNKS (thunk, NULL_TREE); DECL_CONTEXT (thunk) = DECL_CONTEXT (function); TREE_READONLY (thunk) = TREE_READONLY (function); @@ -157,7 +158,7 @@ make_thunk (tree function, bool this_adjusting, /* Add it to the list of thunks associated with FUNCTION. */ DECL_CHAIN (thunk) = DECL_THUNKS (function); - DECL_THUNKS (function) = thunk; + SET_DECL_THUNKS (function, thunk); return thunk; } |