]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree.c (get_callee_fndecl): Move DECL_ABSTRACT_ORIGIN-following...
authorAlexandre Oliva <aoliva@redhat.com>
Thu, 6 Dec 2001 17:58:23 +0000 (17:58 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Thu, 6 Dec 2001 17:58:23 +0000 (17:58 +0000)
* tree.c (get_callee_fndecl): Move DECL_ABSTRACT_ORIGIN-following...
* tree-inline.c (expand_call_inline): ... here.

From-SVN: r47725

gcc/ChangeLog
gcc/tree-inline.c
gcc/tree.c

index 6ce3c3b6a694f544dbadac518bc613deaf5b29af..1714191b0785ccf6a51a2159d2c47a2ddf55f024 100644 (file)
@@ -1,3 +1,8 @@
+2001-12-06  Alexandre Oliva  <aoliva@redhat.com>
+
+       * tree.c (get_callee_fndecl): Move DECL_ABSTRACT_ORIGIN-following...
+       * tree-inline.c (expand_call_inline): ... here.
+
 2001-12-06  H.J. Lu <hjl@gnu.org>
 
        * Makefile.in (.po.gmo): Use "-mkdir po" for parallel build.
index 1444edf10ea03d4a91729f24f5ca74af96cae3d8..6cd1fbb5e15ba3a7aa61e4bb95601abfb5ed9a03 100644 (file)
@@ -807,6 +807,18 @@ expand_call_inline (tp, walk_subtrees, data)
   if (!fn)
     return NULL_TREE;
 
+  /* If fn is a declaration of a function in a nested scope that was
+     globally declared inline, we don't set its DECL_INITIAL.
+     However, we can't blindly follow DECL_ABSTRACT_ORIGIN because the
+     C++ front-end uses it for cdtors to refer to their internal
+     declarations, that are not real functions.  Fortunately those
+     don't have trees to be saved, so we can tell by checking their
+     DECL_SAVED_TREE.  */
+  if (! DECL_INITIAL (fn)
+      && DECL_ABSTRACT_ORIGIN (fn)
+      && DECL_SAVED_TREE (DECL_ABSTRACT_ORIGIN (fn)))
+    fn = DECL_ABSTRACT_ORIGIN (fn);
+
   /* Don't try to inline functions that are not well-suited to
      inlining.  */
   if (!inlinable_function_p (fn, id))
index c21f9132211161ff928e7d61e60be43f2fa9b36d..b60fdc74b81138df9da0a60b21cc718bd492016e 100644 (file)
@@ -4382,23 +4382,7 @@ get_callee_fndecl (call)
      that `f' is being called.  */
   if (TREE_CODE (addr) == ADDR_EXPR
       && TREE_CODE (TREE_OPERAND (addr, 0)) == FUNCTION_DECL)
-    {
-      tree fn = TREE_OPERAND (addr, 0);
-
-      /* If fn is a declaration of a function in a nested scope that
-         was globally declared inline, we don't set its DECL_INITIAL.
-         However, we can't blindly follow DECL_ABSTRACT_ORIGIN because
-         the C++ front-end uses it for cdtors to refer to their
-         internal declarations, that are not real functions.
-         Fortunately those don't have trees to be saved, so we can tell by
-         checking their DECL_SAVED_TREE.  */
-      if (! DECL_INITIAL (fn)
-         && DECL_ABSTRACT_ORIGIN (fn)
-         && DECL_SAVED_TREE (DECL_ABSTRACT_ORIGIN (fn)))
-       fn = DECL_ABSTRACT_ORIGIN (fn);
-
-      return fn;
-    }
+    return TREE_OPERAND (addr, 0);
 
   /* We couldn't figure out what was being called.  */
   return NULL_TREE;