aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2001-05-04 03:03:39 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2001-05-04 03:03:39 +0000
commitacc72c37744ddd4cfb99f2db8e52138964e09ae5 (patch)
treef92c6c67323714acc8bf3cec386c1ed11c545945 /gcc
parent4091fa5f1bc6c0e1703c7245e0faf76e3bb579a4 (diff)
downloadgcc-acc72c37744ddd4cfb99f2db8e52138964e09ae5.zip
gcc-acc72c37744ddd4cfb99f2db8e52138964e09ae5.tar.gz
gcc-acc72c37744ddd4cfb99f2db8e52138964e09ae5.tar.bz2
cp-tree.h (flag_inline_trees): Update documentation.
* cp-tree.h (flag_inline_trees): Update documentation. * decl.c (init_decl_processing): Adjust handling of flag_inline_functions and flag_inline_trees to support -O3. (grokfndecl): Set DECL_INLINE on all functions if that's what the user requested. (save_function_data): Clear DECL_INLINE in current_function_cannot_inline is non-NULL. * decl2.c (flag_inline_trees): Update documentation. From-SVN: r41822
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog11
-rw-r--r--gcc/cp/cp-tree.h6
-rw-r--r--gcc/cp/decl.c22
-rw-r--r--gcc/cp/decl2.c6
4 files changed, 35 insertions, 10 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e98d1ab..0acfdb9 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,14 @@
+2001-05-03 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-tree.h (flag_inline_trees): Update documentation.
+ * decl.c (init_decl_processing): Adjust handling of
+ flag_inline_functions and flag_inline_trees to support -O3.
+ (grokfndecl): Set DECL_INLINE on all functions if that's what
+ the user requested.
+ (save_function_data): Clear DECL_INLINE in
+ current_function_cannot_inline is non-NULL.
+ * decl2.c (flag_inline_trees): Update documentation.
+
2001-05-03 Nathan Sidwell <nathan@codesourcery.com>
* dump.c (cp_dump_tree, USING_STMT case): New case.
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 69623fb..05a0d0f 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -3445,8 +3445,10 @@ extern int flag_implicit_templates;
extern int flag_weak;
-/* Nonzero if we should expand functions calls inline at the tree
- level, rather than at the RTL level. */
+/* 0 if we should not perform inlining.
+ 1 if we should expand functions calls inline at the tree level.
+ 2 if we should consider *all* functions to be inline
+ candidates. */
extern int flag_inline_trees;
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 0e8a44b..54d84f4 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -6365,6 +6365,11 @@ init_decl_processing ()
flag_inline_trees = 1;
flag_no_inline = 1;
}
+ if (flag_inline_functions)
+ {
+ flag_inline_trees = 2;
+ flag_inline_functions = 0;
+ }
/* Initially, C. */
current_lang_name = lang_name_c;
@@ -6547,10 +6552,6 @@ init_decl_processing ()
if (flag_exceptions)
init_exception_processing ();
- if (flag_no_inline)
- {
- flag_inline_functions = 0;
- }
if (! supports_one_only ())
flag_weak = 0;
@@ -8838,8 +8839,13 @@ grokfndecl (ctype, type, declarator, orig_declarator, virtualp, flags, quals,
DECL_NOT_REALLY_EXTERN (decl) = 1;
}
+ /* If the declaration was declared inline, mark it as such. */
if (inlinep)
- DECL_DECLARED_INLINE_P (decl) = DECL_INLINE (decl) = 1;
+ DECL_DECLARED_INLINE_P (decl) = 1;
+ /* We inline functions that are explicitly declared inline, or, when
+ the user explicitly asks us to, all functions. */
+ if (DECL_DECLARED_INLINE_P (decl) || flag_inline_trees == 2)
+ DECL_INLINE (decl) = 1;
DECL_EXTERNAL (decl) = 1;
if (quals != NULL_TREE && TREE_CODE (type) == FUNCTION_TYPE)
@@ -13771,7 +13777,11 @@ save_function_data (decl)
/* If we've already decided that we cannot inline this function, we
must remember that fact when we actually go to expand the
function. */
- f->cannot_inline = current_function_cannot_inline;
+ if (current_function_cannot_inline)
+ {
+ f->cannot_inline = current_function_cannot_inline;
+ DECL_INLINE (decl) = 0;
+ }
}
/* At the end of every constructor we generate to code to return
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 768fd5f..73b9afd 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -396,8 +396,10 @@ int flag_use_cxa_atexit;
int flag_honor_std = 1;
-/* Nonzero if we should expand functions calls inline at the tree
- level, rather than at the RTL level. */
+/* 0 if we should not perform inlining.
+ 1 if we should expand functions calls inline at the tree level.
+ 2 if we should consider *all* functions to be inline
+ candidates. */
int flag_inline_trees = 0;