Commit f120f901 by Mark Mitchell Committed by Mark Mitchell

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
parent ea1e32f6
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) Fri Oct 22 18:05:43 1999 Jeffrey A Law (law@cygnus.com)
* arm.c (logical_binary_operator): New fucntion. * arm.c (logical_binary_operator): New fucntion.
......
...@@ -1419,23 +1419,23 @@ integrate_decl_tree (let, map) ...@@ -1419,23 +1419,23 @@ integrate_decl_tree (let, map)
if (DECL_LANG_SPECIFIC (d)) if (DECL_LANG_SPECIFIC (d))
copy_lang_decl (d); copy_lang_decl (d);
/* ??? We used to call pushdecl here, but that does not work now that /* Set the context for the new declaration. */
we generate entire functions as trees. We only want the pushdecl if (!DECL_CONTEXT (t))
code that sets DECL_CONTEXT. Each front end sets DECL_CONTEXT /* Globals stay global. */
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 else if (DECL_CONTEXT (t) != map->fndecl)
C front end and hope that is sufficient. Alternatively, we could /* Things that weren't in the scope of the function we're
set DECL_CONTEXT (d) here only if DECL_CONTEXT (t) is non-null. */ inlining from aren't in the scope we're inlining too,
/* This new declaration is now in the scope of the function into either. */
which we are inlining the function, not the function being ;
inlined. */ else if (TREE_STATIC (t))
DECL_CONTEXT (d) = current_function_decl; /* Function-scoped static variables should say in the original
/* A local extern declaration for a function doesn't constitute nesting. function. */
A local auto declaration does, since it's a forward decl ;
for a nested function coming later. */ else
if (TREE_CODE (d) == FUNCTION_DECL && DECL_INITIAL (d) == 0 /* Ordinary automatic local variables are now in the scope of
&& DECL_EXTERNAL (d)) the new function. */
DECL_CONTEXT (d) = 0; DECL_CONTEXT (d) = current_function_decl;
/* Add this declaration to the list of variables in the new /* Add this declaration to the list of variables in the new
block. */ block. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment