diff options
author | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-03-26 15:17:26 +0000 |
---|---|---|
committer | aph <aph@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-03-26 15:17:26 +0000 |
commit | bde8fea72a788f83cc7474873d740cdfb9f8b0b8 (patch) | |
tree | 392b46675f0b09d93fe3d049ece00523cb4af3c4 /gcc | |
parent | 204cb876eb685839a04509975b6ddd6caf4a48a9 (diff) | |
download | gcc-bde8fea72a788f83cc7474873d740cdfb9f8b0b8.tar.gz |
2009-03-26 Andrew Haley <aph@redhat.com>
PR C++/39380
* decl2.c (possibly_inlined_p): If java exceptions are in use
don't inline a decl unless it is explicitly marked inline.
* lex.c: (pragma_java_exceptions): New variable.
(handle_pragma_java_exceptions): Set pragma_java_exceptions.
* cp-tree.h (pragma_java_exceptions): Declare new variable.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145091 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 3 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 2 | ||||
-rw-r--r-- | gcc/cp/lex.c | 3 |
4 files changed, 16 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2d4c9f3aa21..bac3d7a7a8d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,12 @@ +2009-03-26 Andrew Haley <aph@redhat.com> + + PR C++/39380 + * decl2.c (possibly_inlined_p): If java exceptions are in use + don't inline a decl unless it is explicitly marked inline. + * lex.c: (pragma_java_exceptions): New variable. + (handle_pragma_java_exceptions): Set pragma_java_exceptions. + * cp-tree.h (pragma_java_exceptions): Declare new variable. + 2009-03-24 Jason Merrill <jason@redhat.com> PR c++/28274 diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 1745ede53c3..6b67d2dd62c 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -4171,6 +4171,9 @@ struct tinst_level GTY(()) e.g "int f(void)". */ extern cp_parameter_declarator *no_parameters; +/* True if we saw "#pragma GCC java_exceptions". */ +extern bool pragma_java_exceptions; + /* in call.c */ extern bool check_dtor_name (tree, tree); diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index deba8b4e01c..2be621da7c5 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -3772,7 +3772,7 @@ possibly_inlined_p (tree decl) gcc_assert (TREE_CODE (decl) == FUNCTION_DECL); if (DECL_UNINLINABLE (decl)) return false; - if (!optimize) + if (!optimize || pragma_java_exceptions) return DECL_DECLARED_INLINE_P (decl); /* When optimizing, we might inline everything when flatten attribute or heuristics inlining for size or autoinlining diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index d708b09658b..66377ff1564 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -81,6 +81,8 @@ struct impl_files static struct impl_files *impl_file_chain; +/* True if we saw "#pragma GCC java_exceptions". */ +bool pragma_java_exceptions; void cxx_finish (void) @@ -430,6 +432,7 @@ handle_pragma_java_exceptions (cpp_reader* dfile ATTRIBUTE_UNUSED) warning (0, "junk at end of #pragma GCC java_exceptions"); choose_personality_routine (lang_java); + pragma_java_exceptions = true; } /* Issue an error message indicating that the lookup of NAME (an |