Skip to content

Commit 170ecd9

Browse files
committed
Use dump_flags_t
1 parent 9ae7bb3 commit 170ecd9

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

gcc-python-compat.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
#include "gimple.h"
2424
#include "tree.h"
2525

26+
#if GCC_VERSION < 8000
27+
typedef int dump_flags_t;
28+
#endif
29+
2630
/*
2731
There are a few GCC symbols that don't seem to be exposed in the plugin
2832
headers, but I wish were.
@@ -39,8 +43,7 @@
3943
the plugin headers AFAIK:
4044
*/
4145
extern void
42-
dump_gimple_stmt (pretty_printer *buffer, gimple gs, int spc, int flags);
43-
46+
dump_gimple_stmt (pretty_printer *buffer, gimple gs, int spc, dump_flags_t flags);
4447

4548
/*
4649
This is declared in gcc/tree-pretty-print.c (around line 580); it was only
@@ -54,7 +57,7 @@ dump_gimple_stmt (pretty_printer *buffer, gimple gs, int spc, int flags);
5457
*/
5558
#if GCC_VERSION < 4009
5659
extern int
57-
dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
60+
dump_generic_node (pretty_printer *buffer, tree node, int spc, dump_flags_t flags,
5861
bool is_stmt);
5962
#endif
6063

gcc-python-gimple.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ PyGccGimple_as_gcc_gimple_label(struct PyGccGimple *self)
9797
}
9898

9999
static PyObject *
100-
do_pretty_print(struct PyGccGimple * self, int spc, int flags)
100+
do_pretty_print(struct PyGccGimple * self, int spc, dump_flags_t flags)
101101
{
102102
PyObject *ppobj = PyGccPrettyPrinter_New();
103103
PyObject *result = NULL;
@@ -141,7 +141,7 @@ PyGccGimple_repr(struct PyGccGimple * self)
141141
PyObject *
142142
PyGccGimple_str(struct PyGccGimple * self)
143143
{
144-
return do_pretty_print(self, 0, 0);
144+
return do_pretty_print(self, 0, (dump_flags_t)0);
145145
}
146146

147147
long

gcc-python-tree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ raise_not_during_lto(const char *what)
107107
Code for various tree types
108108
*/
109109
static PyObject *
110-
do_pretty_print(struct PyGccTree * self, int spc, int flags)
110+
do_pretty_print(struct PyGccTree * self, int spc, dump_flags_t flags)
111111
{
112112
PyObject *ppobj = PyGccPrettyPrinter_New();
113113
PyObject *result = NULL;
@@ -173,7 +173,7 @@ PyGccCaseLabelExpr_New(gcc_case_label_expr t)
173173
PyObject *
174174
PyGccTree_str(struct PyGccTree * self)
175175
{
176-
return do_pretty_print(self, 0, 0);
176+
return do_pretty_print(self, 0, (dump_flags_t)0);
177177
}
178178

179179
long

0 commit comments

Comments
 (0)