aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-10-24 04:08:16 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-10-24 04:08:16 +0000
commitf120f9018d86dd298e90e491faa9d231ad424805 (patch)
tree0e06e50fb911e6ce7c9899a592714185e2593146 /gcc
parentea1e32f66f22ce3ffb346374c5ff7f0a06356165 (diff)
downloadgcc-f120f9018d86dd298e90e491faa9d231ad424805.zip
gcc-f120f9018d86dd298e90e491faa9d231ad424805.tar.gz
gcc-f120f9018d86dd298e90e491faa9d231ad424805.tar.bz2
integrate.c (integrate_decl_tree): Tweak setting of DECL_CONTEXT for inlined declarations.
* integrate.c (integrate_decl_tree): Tweak setting of DECL_CONTEXT for inlined declarations. From-SVN: r30140
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/integrate.c34
2 files changed, 22 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index de9003a..6192c8e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Sat Oct 23 21:13:00 1999 Mark Mitchell <mark@codesourcery.com>
+
+ * integrate.c (integrate_decl_tree): Tweak setting of DECL_CONTEXT
+ for inlined declarations.
+
Fri Oct 22 18:05:43 1999 Jeffrey A Law (law@cygnus.com)
* arm.c (logical_binary_operator): New fucntion.
diff --git a/gcc/integrate.c b/gcc/integrate.c
index e312b18..6c5abe8 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -1419,23 +1419,23 @@ integrate_decl_tree (let, map)
if (DECL_LANG_SPECIFIC (d))
copy_lang_decl (d);
- /* ??? We used to call pushdecl here, but that does not work now that
- we generate entire functions as trees. We only want the pushdecl
- code that sets DECL_CONTEXT. Each front end sets DECL_CONTEXT
- slightly differently though, so we may need new callbacks to the
- front-ends to do this right. For now, we just use the code from the
- C front end and hope that is sufficient. Alternatively, we could
- set DECL_CONTEXT (d) here only if DECL_CONTEXT (t) is non-null. */
- /* This new declaration is now in the scope of the function into
- which we are inlining the function, not the function being
- inlined. */
- DECL_CONTEXT (d) = current_function_decl;
- /* A local extern declaration for a function doesn't constitute nesting.
- A local auto declaration does, since it's a forward decl
- for a nested function coming later. */
- if (TREE_CODE (d) == FUNCTION_DECL && DECL_INITIAL (d) == 0
- && DECL_EXTERNAL (d))
- DECL_CONTEXT (d) = 0;
+ /* Set the context for the new declaration. */
+ if (!DECL_CONTEXT (t))
+ /* Globals stay global. */
+ ;
+ else if (DECL_CONTEXT (t) != map->fndecl)
+ /* Things that weren't in the scope of the function we're
+ inlining from aren't in the scope we're inlining too,
+ either. */
+ ;
+ else if (TREE_STATIC (t))
+ /* Function-scoped static variables should say in the original
+ function. */
+ ;
+ else
+ /* Ordinary automatic local variables are now in the scope of
+ the new function. */
+ DECL_CONTEXT (d) = current_function_decl;
/* Add this declaration to the list of variables in the new
block. */