public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [tuples] Remove remaining access macros
@ 2007-07-25 20:53 Diego Novillo
  0 siblings, 0 replies; only message in thread
From: Diego Novillo @ 2007-07-25 20:53 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 116 bytes --]


This patch removes the last remaining macros (GIMPLE_CODE, GIMPLE_NEXT,
...).

Tested with gimple.exp.  Committed.

[-- Attachment #2: 20070725-remove-macros.diff --]
[-- Type: text/x-patch, Size: 21317 bytes --]

2007-07-25  Diego Novillo  <dnovillo@google.com>

	* gimple.c: Use ENABLE_GIMPLE_CHECKING instead of
	ENABLE_TREE_CHECKING.
	(set_gimple_code): New.
	(set_gimple_prev): New.
	(set_gimple_next): New.
	* gimple.h: Use ENABLE_GIMPLE_CHECKING instead of
	ENABLE_TREE_CHECKING.
	(gimple_code): Inline function replacement for GIMPLE_CODE.
	(gimple_flags): Inline function replacement for GIMPLE_SUBCODE_FLAGS.
	(gimple_next): Inline function replacement for GIMPLE_NEXT.
	(gimple_prev): Inline function replacement for GIMPLE_PREV.
	(gimple_locus): Inline function replacement for GIMPLE_LOCUS.
	(gimple_locus_empty_p): Inline function replacement for
	GIMPLE_LOCUS_EMPTY_P.
	(struct gimple_statement_base): Rename field 'subcode_flags'
	to 'flags'.
	(set_gimple_flags): New.
	(gimple_bb): New.
	(set_gimple_bb): New.
	(set_gimple_block): New.
	(set_gimple_locus): New.
	(add_gimple_flag): Rename from gimple_add_subcode_flag.

Index: gimple-iterator.h
===================================================================
--- gimple-iterator.h	(revision 126917)
+++ gimple-iterator.h	(working copy)
@@ -76,7 +76,7 @@ gsi_one_before_end_p (gimple_stmt_iterat
 static inline void
 gsi_next (gimple_stmt_iterator *i)
 {
-  i->stmt = GIMPLE_NEXT (i->stmt);
+  i->stmt = gimple_next (i->stmt);
 }
 
 /* Return the previous gimple statement in I.  */
@@ -84,7 +84,7 @@ gsi_next (gimple_stmt_iterator *i)
 static inline void
 gsi_prev (gimple_stmt_iterator *i)
 {
-  i->stmt = GIMPLE_PREV (i->stmt);
+  i->stmt = gimple_prev (i->stmt);
 }
 
 /* Return the current stmt.  */
Index: gimple-pretty-print.c
===================================================================
--- gimple-pretty-print.c	(revision 126917)
+++ gimple-pretty-print.c	(working copy)
@@ -49,7 +49,7 @@ static void
 do_niy (pretty_printer *buffer, gimple gs)
 {
   pp_printf (buffer, "<<< Unknown GIMPLE statement: %s >>>\n",
-	     gimple_code_name[(int) GIMPLE_CODE (gs)]);
+	     gimple_code_name[(int) gimple_code (gs)]);
 }
 
 
@@ -157,7 +157,7 @@ dump_gimple_assign (pretty_printer *buff
     {
       dump_generic_node (buffer, gimple_assign_rhs1 (gs), spc, flags, false);
       pp_space (buffer);
-      pp_string (buffer, op_symbol_code (GIMPLE_SUBCODE_FLAGS (gs)));
+      pp_string (buffer, op_symbol_code (gimple_flags (gs)));
       pp_space (buffer);
       dump_generic_node (buffer, gimple_assign_rhs2 (gs), spc, flags, false);
     }
@@ -264,7 +264,7 @@ dump_gimple_cond (pretty_printer *buffer
   pp_string (buffer, "if (");
   dump_generic_node (buffer, gimple_cond_lhs (gs), spc, flags, false);
   pp_space (buffer);
-  pp_string (buffer, op_gimple_cond (GIMPLE_SUBCODE_FLAGS (gs)));
+  pp_string (buffer, op_gimple_cond (gimple_flags (gs)));
   pp_space (buffer);
   dump_generic_node (buffer, gimple_cond_rhs (gs), spc, flags, false);
   pp_character (buffer, ')');
@@ -350,7 +350,7 @@ dump_gimple_try (pretty_printer *buffer,
   newline_and_indent (buffer, spc + 2);
   dump_gimple_seq (buffer, gimple_try_eval (gs), spc + 2, flags);
   newline_and_indent (buffer, spc);
-  if (GIMPLE_SUBCODE_FLAGS (gs) == GIMPLE_TRY_CATCH)
+  if (gimple_flags (gs) == GIMPLE_TRY_CATCH)
     pp_string (buffer, "} catch {");
   else
     pp_string (buffer, "} finally {");
@@ -371,7 +371,7 @@ dump_gimple_stmt (pretty_printer *buffer
   if (!gs)
     return;
 
-  switch (GIMPLE_CODE (gs))
+  switch (gimple_code (gs))
     {
     case GIMPLE_ASSIGN:
       dump_gimple_assign (buffer, gs, spc, flags);
Index: gimplify.c
===================================================================
--- gimplify.c	(revision 126921)
+++ gimplify.c	(working copy)
@@ -634,7 +634,7 @@ static tree
 get_tmp_var_for (gimple stmt)
 {
   tree lhs;
-  enum gimple_code code = GIMPLE_CODE (stmt);
+  enum gimple_code code = gimple_code (stmt);
 
   /* FIXME tuples, add support for formal temporaries (worth it?)  */
   if (code == GIMPLE_ASSIGN)
@@ -659,11 +659,11 @@ declare_vars (tree vars, gimple scope, b
     {
       tree temps, block;
 
-      gcc_assert (GIMPLE_CODE (scope) == GIMPLE_BIND);
+      gcc_assert (gimple_code (scope) == GIMPLE_BIND);
 
       temps = nreverse (last);
 
-      block = GIMPLE_BLOCK (scope);
+      block = gimple_block (scope);
       gcc_assert (!block || TREE_CODE (block) == BLOCK);
       if (!block || !debug_info)
 	{
@@ -762,7 +762,7 @@ should_carry_locus_p (gimple gs)
   /* Don't emit a line note for a label.  We particularly don't want to
      emit one for the break label, since it doesn't actually correspond
      to the beginning of the loop/switch.  */
-  if (GIMPLE_CODE (gs) == GIMPLE_LABEL)
+  if (gimple_code (gs) == GIMPLE_LABEL)
     return false;
 
   return true;
@@ -772,9 +772,8 @@ static void
 annotate_one_with_locus (gimple gs, location_t locus)
 {
   /* All gimple statements have location.  */
-
-  if (GIMPLE_LOCUS_EMPTY_P (gs) && should_carry_locus_p (gs))
-    GIMPLE_LOCUS (gs) = locus;
+  if (gimple_locus_empty_p (gs) && should_carry_locus_p (gs))
+    set_gimple_locus (gs, locus);
 }
 
 void
@@ -1395,7 +1394,6 @@ sort_case_labels (VEC(tree,heap)* label_
 static enum gimplify_status
 gimplify_switch_expr (tree *expr_p, gimple_seq pre_p)
 {
-  enum gimplify_status ret;
   gimple_seq switch_body_seq;
   tree switch_expr;
   switch_expr = *expr_p;
@@ -1478,7 +1476,8 @@ gimplify_switch_expr (tree *expr_p, gimp
     }
   else
     gcc_assert (SWITCH_LABELS (switch_expr));
-  return ret;
+
+  return GS_ALL_DONE;
 }
 
 
@@ -6727,7 +6726,7 @@ gimplify_body (tree *body_p, gimple_seq 
     }
 
   /* If there isn't an outer GIMPLE_BIND, add one.  */
-  if (GIMPLE_CODE (outer_bind) != GIMPLE_BIND)
+  if (gimple_code (outer_bind) != GIMPLE_BIND)
     {
       outer_bind = build_gimple_bind (NULL_TREE, seq_p);
       gimple_add (seq_p, outer_bind);
@@ -6873,8 +6872,8 @@ force_gimple_operand (tree expr, gimple_
 
 tree
 force_gimple_operand_bsi (block_stmt_iterator *bsi ATTRIBUTE_UNUSED, tree expr,
-			  bool simple_p, tree var, bool before,
-			  enum bsi_iterator_update m)
+			  bool simple_p, tree var, bool before ATTRIBUTE_UNUSED,
+			  enum bsi_iterator_update m ATTRIBUTE_UNUSED)
 {
   struct gimple_sequence stmts;
 
Index: c-common.c
===================================================================
--- c-common.c	(revision 126917)
+++ c-common.c	(working copy)
@@ -6445,7 +6445,7 @@ c_warn_unused_result (gimple_seq seq)
     {
       gimple g = gsi_stmt (i);
 
-      switch (GIMPLE_CODE (g))
+      switch (gimple_code (g))
 	{
 	case GIMPLE_BIND:
 	  c_warn_unused_result (gimple_bind_body (g));
@@ -6481,14 +6481,16 @@ c_warn_unused_result (gimple_seq seq)
 
 	  if (lookup_attribute ("warn_unused_result", TYPE_ATTRIBUTES (ftype)))
 	    {
+	      location_t loc = gimple_locus (g);
+
 	      if (fdecl)
 		warning (0, "%Hignoring return value of %qD, "
 			 "declared with attribute warn_unused_result",
-			 &GIMPLE_LOCUS (g), fdecl);
+			 &loc, fdecl);
 	      else
 		warning (0, "%Hignoring return value of function "
 			 "declared with attribute warn_unused_result",
-			 &GIMPLE_LOCUS (g));
+			 &loc);
 	    }
 	  break;
 
Index: gimple.c
===================================================================
--- gimple.c	(revision 126921)
+++ gimple.c	(working copy)
@@ -46,6 +46,32 @@ static struct pointer_map_t *gimple_bodi
    Note: Any constructor taking a ``gimple_seq'' as a parameter, can
    be passed a NULL to start with an empty sequence.  */
 
+/* Set the code for statement G to CODE.  */
+
+static inline void
+set_gimple_code (gimple g, enum gimple_code code)
+{
+  g->base.code = code;
+}
+
+
+/* Set PREV to be the previous statement to G.  */
+
+static inline void
+set_gimple_prev (gimple g, gimple prev)
+{
+  g->base.prev = prev;
+}
+
+
+/* Set NEXT to be the next statement to G.  */
+
+static inline void
+set_gimple_next (gimple g, gimple next)
+{
+  g->base.next = next;
+}
+
 
 /* Return the GSS_* identifier for the given GIMPLE statement CODE.  */
 
@@ -101,8 +127,8 @@ build_gimple_with_ops (enum gimple_code 
   else
     gcc_unreachable ();
 
-  GIMPLE_CODE (s) = code;
-  GIMPLE_SUBCODE_FLAGS (s) = subcode;
+  set_gimple_code (s, code);
+  set_gimple_flags (s, subcode);
   s->with_ops.num_ops = num_ops;
   s->with_ops.op = ggc_alloc_cleared (sizeof (tree) * num_ops);
 
@@ -281,7 +307,7 @@ gimple 
 build_gimple_nop (void)
 {
   gimple p = ggc_alloc_cleared (sizeof (struct gimple_statement_base));
-  GIMPLE_CODE (p) = GIMPLE_NOP;
+  set_gimple_code (p, GIMPLE_NOP);
   return p;
 }
 
@@ -293,7 +319,7 @@ gimple
 build_gimple_bind (tree vars, gimple_seq body)
 {
   gimple p = ggc_alloc_cleared (sizeof (struct gimple_statement_bind));
-  GIMPLE_CODE (p) = GIMPLE_BIND;
+  set_gimple_code (p, GIMPLE_BIND);
   gimple_bind_set_vars (p, vars);
   if (body)
     gimple_bind_set_body (p, body);
@@ -318,7 +344,7 @@ build_gimple_asm (const char *string, un
 
   p = ggc_alloc_cleared (sizeof (struct gimple_statement_asm)
                          + sizeof (tree) * (ninputs + noutputs + nclobbers - 1));
-  GIMPLE_CODE (p) = GIMPLE_ASM;
+  set_gimple_code (p, GIMPLE_ASM);
   p->gimple_asm.ni = ninputs;
   p->gimple_asm.no = noutputs;
   p->gimple_asm.nc = nclobbers;
@@ -351,7 +377,7 @@ build_gimple_catch (tree types, gimple_s
   gimple p;
 
   p = ggc_alloc_cleared (sizeof (struct gimple_statement_catch));
-  GIMPLE_CODE (p) = GIMPLE_CATCH;
+  set_gimple_code (p, GIMPLE_CATCH);
   gimple_catch_set_types (p, types);
   if (handler)
     gimple_catch_set_handler (p, handler);
@@ -370,7 +396,7 @@ build_gimple_eh_filter (tree types, gimp
   gimple p;
 
   p = ggc_alloc_cleared (sizeof (struct gimple_statement_eh_filter));
-  GIMPLE_CODE (p) = GIMPLE_EH_FILTER;
+  set_gimple_code (p, GIMPLE_EH_FILTER);
   gimple_eh_filter_set_types (p, types);
   if (failure)
     gimple_eh_filter_set_failure (p, failure);
@@ -394,12 +420,12 @@ build_gimple_try (gimple_seq eval, gimpl
   gcc_assert (catch_finally == GIMPLE_TRY_CATCH
 	      || catch_finally == GIMPLE_TRY_FINALLY);
   p = ggc_alloc_cleared (sizeof (struct gimple_statement_try));
-  GIMPLE_CODE (p) = GIMPLE_TRY;
+  set_gimple_code (p, GIMPLE_TRY);
   if (eval)
     gimple_try_set_eval (p, eval);
   if (cleanup)
     gimple_try_set_cleanup (p, cleanup);
-  GIMPLE_SUBCODE_FLAGS (p) = catch_finally;
+  set_gimple_flags (p, catch_finally);
 
   return p;
 }
@@ -421,7 +447,7 @@ build_gimple_phi (unsigned capacity, uns
   p = ggc_alloc_cleared (sizeof (struct gimple_statement_phi)
 			 + (sizeof (struct phi_arg_d) * (nargs - 1)) );
   
-  GIMPLE_CODE (p) = GIMPLE_PHI;
+  set_gimple_code (p, GIMPLE_PHI);
   gimple_phi_set_capacity (p, capacity);
   gimple_phi_set_nargs (p, nargs);
   gimple_phi_set_result (p, result);
@@ -448,7 +474,7 @@ build_gimple_resx (int region)
   gimple p;
 
   p = ggc_alloc_cleared (sizeof (struct gimple_statement_resx));
-  GIMPLE_CODE (p) = GIMPLE_RESX;
+  set_gimple_code (p, GIMPLE_RESX);
   gimple_resx_set_region (p, region);
   return p;
 }
@@ -528,7 +554,7 @@ build_gimple_omp_critical (gimple_seq bo
   gimple p;
 
   p = ggc_alloc_cleared (sizeof (struct gimple_statement_omp_critical));
-  GIMPLE_CODE (p) = GIMPLE_OMP_CRITICAL;
+  set_gimple_code (p, GIMPLE_OMP_CRITICAL);
   gimple_omp_critical_set_name (p, name);
   if (body)
     gimple_omp_set_body (p, body);
@@ -556,7 +582,7 @@ build_gimple_omp_for (gimple_seq body, t
   gimple p;
 
   p = ggc_alloc_cleared (sizeof (struct gimple_statement_omp_for));
-  GIMPLE_CODE (p) = GIMPLE_OMP_FOR;
+  set_gimple_code (p, GIMPLE_OMP_FOR);
   if (body)
     gimple_omp_set_body (p, body);
   gimple_omp_for_set_clauses (p, clauses);
@@ -585,7 +611,7 @@ build_gimple_omp_parallel (gimple_seq bo
   gimple p;
 
   p = ggc_alloc_cleared (sizeof (struct gimple_statement_omp_parallel));
-  GIMPLE_CODE (p) = GIMPLE_OMP_PARALLEL;
+  set_gimple_code (p, GIMPLE_OMP_PARALLEL);
   if (body)
     gimple_omp_set_body (p, body);
   gimple_omp_parallel_set_clauses (p, clauses);
@@ -605,7 +631,7 @@ build_gimple_omp_section (gimple_seq bod
   gimple p;
 
   p = ggc_alloc_cleared (sizeof (struct gimple_statement_omp));
-  GIMPLE_CODE (p) = GIMPLE_OMP_SECTION;
+  set_gimple_code (p, GIMPLE_OMP_SECTION);
   if (body)
     gimple_omp_set_body (p, body);
 
@@ -621,7 +647,7 @@ build_gimple_omp_master (gimple_seq body
   gimple p;
 
   p = ggc_alloc_cleared (sizeof (struct gimple_statement_omp));
-  GIMPLE_CODE (p) = GIMPLE_OMP_MASTER;
+  set_gimple_code (p, GIMPLE_OMP_MASTER);
   if (body)
     gimple_omp_set_body (p, body);
 
@@ -636,7 +662,7 @@ build_gimple_omp_continue (gimple_seq bo
   gimple p;
 
   p = ggc_alloc_cleared (sizeof (struct gimple_statement_omp));
-  GIMPLE_CODE (p) = GIMPLE_OMP_CONTINUE;
+  set_gimple_code (p, GIMPLE_OMP_CONTINUE);
   if (body)
     gimple_omp_set_body (p, body);
 
@@ -654,7 +680,7 @@ build_gimple_omp_ordered (gimple_seq bod
   gimple p;
 
   p = ggc_alloc_cleared (sizeof (struct gimple_statement_omp));
-  GIMPLE_CODE (p) = GIMPLE_OMP_ORDERED;
+  set_gimple_code (p, GIMPLE_OMP_ORDERED);
   if (body)
     gimple_omp_set_body (p, body);
 
@@ -670,9 +696,9 @@ build_gimple_omp_return (bool wait_p)
   gimple p;
 
   p = ggc_alloc_cleared (sizeof (struct gimple_statement_omp));
-  GIMPLE_CODE (p) = GIMPLE_OMP_RETURN;
+  set_gimple_code (p, GIMPLE_OMP_RETURN);
   if (wait_p)
-    GIMPLE_SUBCODE_FLAGS(p) = OMP_RETURN_NOWAIT_FLAG;
+    set_gimple_flags (p, OMP_RETURN_NOWAIT_FLAG);
 
   return p;
 }
@@ -689,7 +715,7 @@ build_gimple_omp_sections (gimple_seq bo
   gimple p;
 
   p = ggc_alloc_cleared (sizeof (struct gimple_statement_omp_sections));
-  GIMPLE_CODE (p) = GIMPLE_OMP_SECTIONS;
+  set_gimple_code (p, GIMPLE_OMP_SECTIONS);
   if (body)
     gimple_omp_set_body (p, body);
   gimple_omp_sections_set_clauses (p, clauses);
@@ -709,7 +735,7 @@ build_gimple_omp_single (gimple_seq body
   gimple p;
 
   p = ggc_alloc_cleared (sizeof (struct gimple_statement_omp_single));
-  GIMPLE_CODE (p) = GIMPLE_OMP_SINGLE;
+  set_gimple_code (p, GIMPLE_OMP_SINGLE);
   if (body)
     gimple_omp_set_body (p, body);
   gimple_omp_single_set_clauses (p, clauses);
@@ -723,10 +749,10 @@ build_gimple_omp_single (gimple_seq body
 enum gimple_statement_structure_enum
 gimple_statement_structure (gimple gs)
 {
-  return gss_for_code (GIMPLE_CODE (gs));
+  return gss_for_code (gimple_code (gs));
 }
 
-#if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
+#if defined ENABLE_GIMPLE_CHECKING && (GCC_VERSION >= 2007)
 /* Complain of a gimple type mismatch and die.  */
 
 void
@@ -737,8 +763,8 @@ gimple_check_failed (const gimple gs, co
   internal_error ("gimple check: expected %s(%u), have %s(%u) in %s, at %s:%d",
       		  gimple_code_name[code],
 		  subcode,
-		  gimple_code_name[GIMPLE_CODE (gs)],
-		  GIMPLE_SUBCODE_FLAGS (gs),
+		  gimple_code_name[gimple_code (gs)],
+		  gimple_flags (gs),
 		  function, trim_filename (file), line);
 }
 
@@ -772,10 +798,10 @@ gimple_range_check_failed (const gimple 
     }
 
   internal_error ("gimple check: %s, have %s in %s, at %s:%d",
-		  buffer, gimple_code_name[GIMPLE_CODE (gs)],
+		  buffer, gimple_code_name[gimple_code (gs)],
 		  function, trim_filename (file), line);
 }
-#endif /* ENABLE_TREE_CHECKING */
+#endif /* ENABLE_GIMPLE_CHECKING */
 
 
 /* Link a gimple statement(s) to the end of the sequence SEQ.  */
@@ -786,9 +812,9 @@ gimple_add (gimple_seq seq, gimple gs)
   gimple last;
 
   /* Make sure this stmt is not part of another chain.  */
-  gcc_assert (GIMPLE_PREV (gs) == NULL);
+  gcc_assert (gimple_prev (gs) == NULL);
 
-  for (last = gs; GIMPLE_NEXT (last) != NULL; last = GIMPLE_NEXT (last))
+  for (last = gs; gimple_next (last) != NULL; last = gimple_next (last))
     ;
 
   if (gimple_seq_first (seq) == NULL)
@@ -798,8 +824,8 @@ gimple_add (gimple_seq seq, gimple gs)
     }
   else
     {
-      GIMPLE_PREV (gs) = gimple_seq_last (seq);
-      GIMPLE_NEXT (gimple_seq_last (seq)) = gs;
+      set_gimple_prev (gs, gimple_seq_last (seq));
+      set_gimple_next (gimple_seq_last (seq), gs);
       gimple_seq_set_last (seq, last);
     }
 }
@@ -842,7 +868,7 @@ walk_tuple_ops (gimple gs, walk_tree_fn 
     for (i = 0; i < gimple_num_ops (gs); i++)
       WALKIT (gimple_op (gs, i));
   else
-    switch (GIMPLE_CODE (gs))
+    switch (gimple_code (gs))
       {
       case GIMPLE_BIND:
 	WALKIT (gimple_bind_vars (gs));
Index: gimple.h
===================================================================
--- gimple.h	(revision 126921)
+++ gimple.h	(working copy)
@@ -36,15 +36,6 @@ enum gimple_code {
     LAST_AND_UNUSED_GIMPLE_CODE
 };
 
-#define GIMPLE_CODE(G) ((G)->base.code)
-#define GIMPLE_SUBCODE_FLAGS(G) ((G)->base.subcode_flags)
-#define GIMPLE_NEXT(G) ((G)->base.next)
-#define GIMPLE_PREV(G) ((G)->base.prev)
-#define GIMPLE_BLOCK(G)	((G)->base.block)
-#define GIMPLE_LOCUS(G) ((G)->base.locus)
-#define GIMPLE_LOCUS_EMPTY_P(G)	(GIMPLE_LOCUS ((G)).file == NULL \
-				 && GIMPLE_LOCUS ((G)).line == 0)
-
 /* A sequence of gimple statements.  */
 struct gimple_sequence
 {
@@ -103,7 +94,7 @@ gimple_seq_empty_p (gimple_seq s)
 struct gimple_statement_base GTY(())
 {
   ENUM_BITFIELD(gimple_code) code : 16;
-  unsigned int subcode_flags : 16;
+  unsigned int flags : 16;
   gimple next;
   gimple prev;
   struct basic_block_def *bb;
@@ -312,6 +303,88 @@ union gimple_statement_d GTY ((desc ("gi
 };
 
 
+/* Common accessors for all GIMPLE statements.  */
+
+static inline enum gimple_code
+gimple_code (gimple g)
+{
+  return g->base.code;
+}
+
+static inline unsigned
+gimple_flags (gimple g)
+{
+  return g->base.flags;
+}
+
+static inline void
+set_gimple_flags (gimple g, unsigned int flags)
+{
+  g->base.flags = flags;
+}
+
+static inline void
+add_gimple_flag (gimple g, unsigned int flag)
+{
+  g->base.flags |= flag;
+}
+
+static inline gimple
+gimple_next (gimple g)
+{
+  return g->base.next;
+}
+
+static inline gimple
+gimple_prev (gimple g)
+{
+  return g->base.prev;
+}
+
+static inline struct basic_block_def *
+gimple_bb (gimple g)
+{
+  return g->base.bb;
+}
+
+static inline void
+set_gimple_bb (gimple g, struct basic_block_def * bb)
+{
+  g->base.bb = bb;
+}
+
+static inline tree
+gimple_block (gimple g)
+{
+  return g->base.block;
+}
+
+static inline void
+set_gimple_block (gimple g, tree block)
+{
+  g->base.block = block;
+}
+
+static inline location_t
+gimple_locus (gimple g)
+{
+  return g->base.locus;
+}
+
+static inline void
+set_gimple_locus (gimple g, location_t locus)
+{
+  g->base.locus = locus;
+}
+
+static inline bool
+gimple_locus_empty_p (gimple g)
+{
+  return gimple_locus (g).file == NULL && gimple_locus (g).line == 0;
+}
+
+
+
 /* In gimple.c.  */
 extern gimple build_gimple_return (bool, tree);
 extern gimple build_gimple_assign (tree, tree);
@@ -358,7 +431,7 @@ extern const char *const gimple_code_nam
 
 
 /* Error out if a gimple tuple is addressed incorrectly.  */
-#if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
+#if defined ENABLE_GIMPLE_CHECKING && (GCC_VERSION >= 2007)
 extern void gimple_check_failed (const gimple, const char *, int,          \
                                  const char *, unsigned int, unsigned int) \
                                  ATTRIBUTE_NORETURN;                       \
@@ -368,25 +441,25 @@ extern void gimple_range_check_failed (c
 
 #define GIMPLE_CHECK(GS, CODE) __extension__				\
   ({  const gimple __gs = (GS);						\
-      if (GIMPLE_CODE (__gs) != (CODE))					\
+      if (gimple_code (__gs) != (CODE))					\
         gimple_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__,	\
 	  		 (CODE), 0);					\
       __gs; })
 
 #define GIMPLE_CHECK2(GS, CODE1, CODE2) __extension__			\
   ({  const gimple __gs = (GS);						\
-      if (GIMPLE_CODE (__gs) != (CODE1)					\
-	  || GIMPLE_SUBCODE_FLAGS (__gs) != (CODE2))			\
+      if (gimple_code (__gs) != (CODE1)					\
+	  || gimple_flags (__gs) != (CODE2))				\
         gimple_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__,	\
 	  		 (CODE1), (CODE2));				\
       __gs; })
 #define GIMPLE_RANGE_CHECK(GS, CODE1, CODE2) __extension__		\
   ({ const gimple __gs = (GS);						\
-     if (GIMPLE_CODE (__gs) < (CODE1) || GIMPLE_CODE (__gs) > (CODE2))	\
+     if (gimple_code (__gs) < (CODE1) || gimple_code (__gs) > (CODE2))	\
        gimple_range_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__,	\
 		        (CODE1), (CODE2));				\
      __gs; })
-#else  /* not ENABLE_TREE_CHECKING, or not gcc */
+#else  /* not ENABLE_GIMPLE_CHECKING, or not gcc */
 #define GIMPLE_CHECK(GS, CODE)			(GS)
 #define GIMPLE_CHECK2(GS, C1, C2)		(GS)
 #define GIMPLE_RANGE_CHECK(GS, CODE1, CODE2)	(GS)
@@ -1187,14 +1260,14 @@ static inline void
 gimple_assign_omp_for_cond (gimple gs, enum gimple_cond cond)
 {
   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
-  GIMPLE_SUBCODE_FLAGS (gs) =  cond;
+  set_gimple_flags (gs, cond);
 }
 
 static inline enum gimple_cond
 gimple_omp_for_cond (gimple gs)
 {
   GIMPLE_CHECK (gs, GIMPLE_OMP_FOR);
-  return (enum gimple_cond) GIMPLE_SUBCODE_FLAGS (gs);
+  return (enum gimple_cond) gimple_flags (gs);
 }
 
 /* GIMPLE_RETURN accessors.  */
@@ -1224,12 +1297,6 @@ gimple_seq_append (gimple_seq dst, gimpl
     gimple_add (dst, gimple_seq_first (src));
 }
 
-static inline void
-gimple_add_subcode_flag (gimple g, unsigned int flag)
-{
-  GIMPLE_SUBCODE_FLAGS (g) |= flag;
-}
-
 #include "gimple-iterator.h"
 
 #endif  /* GCC_GIMPLE_IR_H */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-25 20:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-25 20:53 [tuples] Remove remaining access macros Diego Novillo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).