remove unused files
[platform/upstream/gcc48.git] / gcc / gimple-streamer-out.c
index a7e73fa..adf230e 100644 (file)
@@ -1,6 +1,6 @@
 /* Routines for emitting GIMPLE to a file stream.
 
-   Copyright 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2013 Free Software Foundation, Inc.
    Contributed by Diego Novillo <dnovillo@google.com>
 
 This file is part of GCC.
@@ -43,7 +43,9 @@ output_phi (struct output_block *ob, gimple phi)
     {
       stream_write_tree (ob, gimple_phi_arg_def (phi, i), true);
       streamer_write_uhwi (ob, gimple_phi_arg_edge (phi, i)->src->index);
-      lto_output_location (ob, gimple_phi_arg_location (phi, i));
+      bitpack_d bp = bitpack_create (ob->main_stream);
+      stream_output_location (ob, &bp, gimple_phi_arg_location (phi, i));
+      streamer_write_bitpack (&bp);
     }
 }
 
@@ -71,10 +73,10 @@ output_gimple_stmt (struct output_block *ob, gimple stmt)
     bp_pack_value (&bp, gimple_assign_nontemporal_move_p (stmt), 1);
   bp_pack_value (&bp, gimple_has_volatile_ops (stmt), 1);
   bp_pack_var_len_unsigned (&bp, stmt->gsbase.subcode);
-  streamer_write_bitpack (&bp);
 
   /* Emit location information for the statement.  */
-  lto_output_location (ob, gimple_location (stmt));
+  stream_output_location (ob, &bp, LOCATION_LOCUS (gimple_location (stmt)));
+  streamer_write_bitpack (&bp);
 
   /* Emit the lexical block holding STMT.  */
   stream_write_tree (ob, gimple_block (stmt), true);
@@ -114,13 +116,14 @@ output_gimple_stmt (struct output_block *ob, gimple stmt)
       for (i = 0; i < gimple_num_ops (stmt); i++)
        {
          tree op = gimple_op (stmt, i);
+         tree *basep = NULL;
          /* Wrap all uses of non-automatic variables inside MEM_REFs
             so that we do not have to deal with type mismatches on
             merged symbols during IL read in.  The first operand
             of GIMPLE_DEBUG must be a decl, not MEM_REF, though.  */
          if (op && (i || !is_gimple_debug (stmt)))
            {
-             tree *basep = &op;
+             basep = &op;
              while (handled_component_p (*basep))
                basep = &TREE_OPERAND (*basep, 0);
              if (TREE_CODE (*basep) == VAR_DECL
@@ -134,8 +137,13 @@ output_gimple_stmt (struct output_block *ob, gimple stmt)
                                                  (TREE_TYPE (*basep)), 0));
                  TREE_THIS_VOLATILE (*basep) = volatilep;
                }
+             else
+               basep = NULL;
            }
          stream_write_tree (ob, op, true);
+         /* Restore the original base if we wrapped it inside a MEM_REF.  */
+         if (basep)
+           *basep = TREE_OPERAND (TREE_OPERAND (*basep, 0), 0);
        }
       if (is_gimple_call (stmt))
        {
@@ -176,7 +184,6 @@ output_bb (struct output_block *ob, basic_block bb, struct function *fn)
 
   streamer_write_uhwi (ob, bb->index);
   streamer_write_hwi (ob, bb->count);
-  streamer_write_hwi (ob, bb->loop_depth);
   streamer_write_hwi (ob, bb->frequency);
   streamer_write_hwi (ob, bb->flags);
 
@@ -211,7 +218,7 @@ output_bb (struct output_block *ob, basic_block bb, struct function *fn)
          /* Only emit PHIs for gimple registers.  PHI nodes for .MEM
             will be filled in on reading when the SSA form is
             updated.  */
-         if (is_gimple_reg (gimple_phi_result (phi)))
+         if (!virtual_operand_p (gimple_phi_result (phi)))
            output_phi (ob, phi);
        }