MAINTAINERS (Write After Approval): Add myself.
[platform/upstream/gcc.git] / gcc / cfgbuild.c
index 05adac0..c1ec46a 100644 (file)
@@ -1,5 +1,5 @@
 /* Control flow graph building code for GNU compiler.
-   Copyright (C) 1987-2014 Free Software Foundation, Inc.
+   Copyright (C) 1987-2016 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -21,19 +21,15 @@ along with GCC; see the file COPYING3.  If not see
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
-#include "tm.h"
-#include "tree.h"
+#include "backend.h"
 #include "rtl.h"
-#include "hard-reg-set.h"
-#include "basic-block.h"
-#include "regs.h"
-#include "flags.h"
-#include "function.h"
+#include "cfghooks.h"
+#include "emit-rtl.h"
+#include "cfgrtl.h"
+#include "cfganal.h"
+#include "cfgbuild.h"
 #include "except.h"
-#include "expr.h"
-#include "diagnostic-core.h"
-#include "timevar.h"
-#include "sbitmap.h"
+#include "stmt.h"
 
 static void make_edges (basic_block, basic_block, int);
 static void make_label_edge (sbitmap, basic_block, rtx, int);
@@ -44,7 +40,7 @@ static void compute_outgoing_frequencies (basic_block);
    block.  */
 
 bool
-inside_basic_block_p (const_rtx insn)
+inside_basic_block_p (const rtx_insn *insn)
 {
   switch (GET_CODE (insn))
     {
@@ -73,7 +69,7 @@ inside_basic_block_p (const_rtx insn)
    the basic block.  */
 
 bool
-control_flow_insn_p (const_rtx insn)
+control_flow_insn_p (const rtx_insn *insn)
 {
   switch (GET_CODE (insn))
     {
@@ -152,7 +148,7 @@ rtl_make_eh_edge (sbitmap edge_cache, basic_block src, rtx insn)
 
   if (lp)
     {
-      rtx label = lp->landing_pad;
+      rtx_insn *label = lp->landing_pad;
 
       /* During initial rtl generation, use the post_landing_pad.  */
       if (label == NULL)
@@ -277,15 +273,15 @@ make_edges (basic_block min, basic_block max, int update_p)
                  && GET_CODE (SET_SRC (tmp)) == IF_THEN_ELSE
                  && GET_CODE (XEXP (SET_SRC (tmp), 2)) == LABEL_REF)
                make_label_edge (edge_cache, bb,
-                                XEXP (XEXP (SET_SRC (tmp), 2), 0), 0);
+                                LABEL_REF_LABEL (XEXP (SET_SRC (tmp), 2)), 0);
            }
 
          /* If this is a computed jump, then mark it as reaching
             everything on the forced_labels list.  */
          else if (computed_jump_p (insn))
            {
-             for (rtx_expr_list *x = forced_labels; x; x = x->next ())
-               make_label_edge (edge_cache, bb, x->element (), EDGE_ABNORMAL);
+             for (rtx_insn_list *x = forced_labels; x; x = x->next ())
+               make_label_edge (edge_cache, bb, x->insn (), EDGE_ABNORMAL);
            }
 
          /* Returns create an exit out.  */
@@ -337,8 +333,10 @@ make_edges (basic_block min, basic_block max, int update_p)
                     taken, then only calls to those functions or to other
                     nested functions that use them could possibly do
                     nonlocal gotos.  */
-                 for (rtx x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1))
-                   make_label_edge (edge_cache, bb, XEXP (x, 0),
+                 for (rtx_insn_list *x = nonlocal_goto_handler_labels;
+                      x;
+                      x = x->next ())
+                   make_label_edge (edge_cache, bb, x->insn (),
                                     EDGE_ABNORMAL | EDGE_ABNORMAL_CALL);
                }
 
@@ -413,7 +411,7 @@ purge_dead_tablejump_edges (basic_block bb, rtx_jump_table_data *table)
        && SET_DEST (tmp) == pc_rtx
        && GET_CODE (SET_SRC (tmp)) == IF_THEN_ELSE
        && GET_CODE (XEXP (SET_SRC (tmp), 2)) == LABEL_REF)
-    mark_tablejump_edge (XEXP (XEXP (SET_SRC (tmp), 2), 0));
+    mark_tablejump_edge (LABEL_REF_LABEL (XEXP (SET_SRC (tmp), 2)));
 
   for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); )
     {