This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[tuples] C++ify gimple.h


The C++ front end does not like implicit casts to void *.  This patch fixes all
allocations of gimple_stmt_iterator's.

Committed to branch.

	* gimple.h (_ALLOC_GSI): New.
	Use it throughout when allocating a new gimple_stmt_iterator.

Index: gimple.h
===================================================================
--- gimple.h	(revision 129237)
+++ gimple.h	(working copy)
@@ -45,6 +45,8 @@ enum gimple_code {
     LAST_AND_UNUSED_GIMPLE_CODE
 };
 
+#define _ALLOC_GSI (gimple_stmt_iterator *) ggc_alloc_cleared \
+  (sizeof (gimple_stmt_iterator))
 
 /* A sequence of gimple statements.  */
 struct gimple_sequence GTY(())
@@ -1798,7 +1800,7 @@ typedef struct {
 static inline gimple_stmt_iterator *
 gsi_start (gimple_seq seq)
 {
-  gimple_stmt_iterator *i = ggc_alloc_cleared (sizeof (gimple_stmt_iterator));
+  gimple_stmt_iterator *i = _ALLOC_GSI;
 
   if (seq)
     {
@@ -1818,7 +1820,7 @@ gsi_start (gimple_seq seq)
 static inline gimple_stmt_iterator *
 gsi_start_bb (basic_block bb)
 {
-  gimple_stmt_iterator *i = ggc_alloc_cleared (sizeof (gimple_stmt_iterator));
+  gimple_stmt_iterator *i = _ALLOC_GSI;
   gimple_seq seq = bb_seq (bb);
 
   if (seq)
@@ -1838,7 +1840,7 @@ gsi_start_bb (basic_block bb)
 static inline gimple_stmt_iterator *
 gsi_last (gimple_seq seq)
 {
-  gimple_stmt_iterator *i = ggc_alloc_cleared (sizeof (gimple_stmt_iterator));
+  gimple_stmt_iterator *i = _ALLOC_GSI;
 
   if (seq)
     {
@@ -1858,7 +1860,7 @@ gsi_last (gimple_seq seq)
 static inline gimple_stmt_iterator *
 gsi_last_bb (basic_block bb)
 {
-  gimple_stmt_iterator *i = ggc_alloc_cleared (sizeof (gimple_stmt_iterator));
+  gimple_stmt_iterator *i = _ALLOC_GSI;
   gimple_seq seq = bb_seq (bb);
 
   if (seq)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]