aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-09-13 07:18:47 -0700
committerRichard Henderson <rth@gcc.gnu.org>2003-09-13 07:18:47 -0700
commitf6d1b84aa4526d360d77c795167cfb217da89e65 (patch)
treeb69aa15ca9ee08567dcb3105ff151e820b8dc09a /gcc/cgraphunit.c
parent8daf2e652621464650af1fce25f1a9f86b2f39a7 (diff)
downloadgcc-f6d1b84aa4526d360d77c795167cfb217da89e65.zip
gcc-f6d1b84aa4526d360d77c795167cfb217da89e65.tar.gz
gcc-f6d1b84aa4526d360d77c795167cfb217da89e65.tar.bz2
cgraphunit.c (cgraph_assemble_pending_functions): Export.
* cgraphunit.c (cgraph_assemble_pending_functions): Export. (cgraph_finalize_function): Revert TREE_ASM_WRITTEN check. * cgraph.h: Update. * decl2.c (finish_file): Check cgraph_assemble_pending_functions during relaxation loop. From-SVN: r71360
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 3519359..f615d1b 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -122,7 +122,8 @@ decide_is_function_needed (struct cgraph_node *node, tree decl)
/* When not doing unit-at-a-time, output all functions enqueued.
Return true when such a functions were found. */
-static bool
+
+bool
cgraph_assemble_pending_functions (void)
{
bool output = false;
@@ -136,9 +137,12 @@ cgraph_assemble_pending_functions (void)
cgraph_nodes_queue = cgraph_nodes_queue->next_needed;
if (!n->origin && !DECL_EXTERNAL (n->decl))
- cgraph_expand_function (n);
- output = true;
+ {
+ cgraph_expand_function (n);
+ output = true;
+ }
}
+
return output;
}
@@ -164,7 +168,13 @@ cgraph_finalize_function (tree decl, bool nested)
??? It may make more sense to use one body for inlining and other
body for expanding the function but this is dificult to do. */
- if (TREE_ASM_WRITTEN (decl))
+ /* If node->output is set, then this is a unit-at-a-time compilation
+ and we have already begun whole-unit analysis. This is *not*
+ testing for whether we've already emitted the function. That
+ case can be sort-of legitimately seen with real function
+ redefinition errors. I would argue that the front end should
+ never present us with such a case, but don't enforce that for now. */
+ if (node->output)
abort ();
/* Reset our datastructures so we can analyze the function again. */