From f45e918245bbc04a34758801624c7b9fff3ebcb9 Mon Sep 17 00:00:00 2001
From: gdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 12 Dec 2005 23:12:14 +0000
Subject: [PATCH] =?UTF-8?q?2005-12-11=20Rafael=20=C3=81vila=20de=20Esp?=
 =?UTF-8?q?=C3=ADndola=20<rafael.espindola@gmail.com>?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

        * tree-flow.h: Allow compilation with a C++ compiler.
        (struct edge_prediction): Prefix all field names  with "ep_".
        * predict.c (tree_predicted_by_p): Likewise for struct
        edge_prediction.
        (tree_predict_edge, combine_predictions_for_bb): Likewise.
        (remove_predictions_associated_with_edge): Likewise.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108430 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog   |  8 ++++++++
 gcc/predict.c   | 34 +++++++++++++++++-----------------
 gcc/tree-flow.h | 10 +++++-----
 3 files changed, 30 insertions(+), 22 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 52c4e1c4967e..7ba1eaa5e49a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2005-12-11 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
+
+        * tree-flow.h: Allow compilation with a C++ compiler.
+        (struct edge_prediction): Prefix all field names  with "ep_".
+        * predict.c (tree_predicted_by_p): Likewise for struct edge_prediction.
+        (tree_predict_edge, combine_predictions_for_bb): Likewise.
+        (remove_predictions_associated_with_edge): Likewise.
+	
 2005-12-12  Jeff Law  <law@redhat.com>
 
 	* tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Remove
diff --git a/gcc/predict.c b/gcc/predict.c
index 8f50ba0287b0..5cd3cb61bd38 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -172,8 +172,8 @@ bool
 tree_predicted_by_p (basic_block bb, enum br_predictor predictor)
 {
   struct edge_prediction *i;
-  for (i = bb->predictions; i; i = i->next)
-    if (i->predictor == predictor)
+  for (i = bb->predictions; i; i = i->ep_next)
+    if (i->ep_predictor == predictor)
       return true;
   return false;
 }
@@ -237,11 +237,11 @@ tree_predict_edge (edge e, enum br_predictor predictor, int probability)
     {
       struct edge_prediction *i = ggc_alloc (sizeof (struct edge_prediction));
 
-      i->next = e->src->predictions;
+      i->ep_next = e->src->predictions;
       e->src->predictions = i;
-      i->probability = probability;
-      i->predictor = predictor;
-      i->edge = e;
+      i->ep_probability = probability;
+      i->ep_predictor = predictor;
+      i->ep_edge = e;
     }
 }
 
@@ -255,10 +255,10 @@ remove_predictions_associated_with_edge (edge e)
       struct edge_prediction **prediction = &e->src->predictions;
       while (*prediction)
 	{
-	  if ((*prediction)->edge == e)
-	    *prediction = (*prediction)->next;
+	  if ((*prediction)->ep_edge == e)
+	    *prediction = (*prediction)->ep_next;
 	  else
-	    prediction = &((*prediction)->next);
+	    prediction = &((*prediction)->ep_next);
 	}
     }
 }
@@ -523,12 +523,12 @@ combine_predictions_for_bb (FILE *file, basic_block bb)
 
   /* We implement "first match" heuristics and use probability guessed
      by predictor with smallest index.  */
-  for (pred = bb->predictions; pred; pred = pred->next)
+  for (pred = bb->predictions; pred; pred = pred->ep_next)
     {
-      int predictor = pred->predictor;
-      int probability = pred->probability;
+      int predictor = pred->ep_predictor;
+      int probability = pred->ep_probability;
 
-      if (pred->edge != first)
+      if (pred->ep_edge != first)
 	probability = REG_BR_PROB_BASE - probability;
 
       found = true;
@@ -569,12 +569,12 @@ combine_predictions_for_bb (FILE *file, basic_block bb)
     combined_probability = best_probability;
   dump_prediction (file, PRED_COMBINED, combined_probability, bb, true);
 
-  for (pred = bb->predictions; pred; pred = pred->next)
+  for (pred = bb->predictions; pred; pred = pred->ep_next)
     {
-      int predictor = pred->predictor;
-      int probability = pred->probability;
+      int predictor = pred->ep_predictor;
+      int probability = pred->ep_probability;
 
-      if (pred->edge != EDGE_SUCC (bb, 0))
+      if (pred->ep_edge != EDGE_SUCC (bb, 0))
 	probability = REG_BR_PROB_BASE - probability;
       dump_prediction (file, predictor, probability, bb,
 		       !first_match || best_predictor == predictor);
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index 4341d6f27a28..62b8027ba62f 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -333,12 +333,12 @@ static inline tree default_def (tree);
 /*---------------------------------------------------------------------------
                   Structure representing predictions in tree level.
 ---------------------------------------------------------------------------*/
-struct edge_prediction GTY((chain_next ("%h.next")))
+struct edge_prediction GTY((chain_next ("%h.ep_next")))
 {
-  struct edge_prediction *next;
-  edge edge;
-  enum br_predictor predictor;
-  int probability;
+  struct edge_prediction *ep_next;
+  edge ep_edge;
+  enum br_predictor ep_predictor;
+  int ep_probability;
 };
 
 /* Accessors for basic block annotations.  */
-- 
GitLab