]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/lto-streamer-out.c
This patch implements generic type query and conversion functions,
[thirdparty/gcc.git] / gcc / lto-streamer-out.c
index 806045b52bf9ef97c00ceb97823e55a29a1a7012..4467eb49e5aba28679ed73ba64a3a771f4c79104 100644 (file)
@@ -956,7 +956,6 @@ copy_function (struct cgraph_node *node)
 static void
 lto_output (void)
 {
-  struct cgraph_node *node;
   struct lto_out_decl_state *decl_state;
 #ifdef ENABLE_CHECKING
   bitmap output = lto_bitmap_alloc ();
@@ -972,10 +971,9 @@ lto_output (void)
   for (i = 0; i < n_nodes; i++)
     {
       symtab_node snode = lto_symtab_encoder_deref (encoder, i);
-      if (!symtab_function_p (snode))
-       continue;
-      node = cgraph (snode);
-      if (lto_symtab_encoder_encode_body_p (encoder, node)
+      cgraph_node *node = dyn_cast <cgraph_node> (snode);
+      if (node
+         && lto_symtab_encoder_encode_body_p (encoder, node)
          && !node->alias
          && !node->thunk.thunk_p)
        {