Message ID | 1455203525.18873.38.camel@redhat.com |
---|---|
State | New |
Headers | show |
Ping: https://gcc.gnu.org/ml/gcc-patches/2016-02/msg00765.html On Thu, 2016-02-11 at 10:12 -0500, David Malcolm wrote: > I've (mostly) ported gcc-python-plugin to gcc 6. The attached patch > for the gcc website starts a new "Plugin issues" section, and covers > the biggest issue I ran into (FWIW the suggested compatibility > typedef > is the one I committed to gcc-python-plugin). > > Validates. > > OK to commit?
Ping On Thu, 2016-02-18 at 10:44 -0500, David Malcolm wrote: > Ping: > https://gcc.gnu.org/ml/gcc-patches/2016-02/msg00765.html > > > On Thu, 2016-02-11 at 10:12 -0500, David Malcolm wrote: > > I've (mostly) ported gcc-python-plugin to gcc 6. The attached > > patch > > for the gcc website starts a new "Plugin issues" section, and > > covers > > the biggest issue I ran into (FWIW the suggested compatibility > > typedef > > is the one I committed to gcc-python-plugin). > > > > Validates. > > > > OK to commit?
Hi David, On Thu, 11 Feb 2016, David Malcolm wrote: > I've (mostly) ported gcc-python-plugin to gcc 6. The attached patch > for the gcc website starts a new "Plugin issues" section, and covers > the biggest issue I ran into (FWIW the suggested compatibility typedef > is the one I committed to gcc-python-plugin). this is lovely, thanks for doing it! Just some small editorial comments; please go ahead and commit after making (or at least considering) them. Index: htdocs/gcc-6/porting_to.html =================================================================== +<h3>"gimple" became a struct, rather than a pointer</h3> Should this be <code>gimple</code>? +Prior to GCC 6, "gimple" meant a <b>pointer</b> to a statement. It was a +typedef aliasing the type <code>struct gimple_statement_base *</code>: Same here. +<p>"gimple" is now the statement <b>struct</b> itself, not a pointer. +The "gimple" struct is now the base class of the gimple statement class +hierarchy, and throughout gcc every <code>gimple</code> was changed to a ..and here. gcc -> GCC How about "every instance of <code>gimple</code>" ? +(revision +<a href="https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=42acab1cd6812e2d9e49f4132176f5505f49a0e5">r227941</a> +was the commit in question). The typedef <code>const_gimple</code> is no more; "is the commit" ? +change. If you aim for compatibility between both gcc 6 and earlier +releases of gcc, it may be cleanest to introduce a compatibility typedef GCC 6 GCC Thank you, Gerald
Index: htdocs/gcc-6/porting_to.html =================================================================== RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-6/porting_to.html,v retrieving revision 1.10 diff -u -p -r1.10 porting_to.html --- htdocs/gcc-6/porting_to.html 11 Feb 2016 10:37:00 -0000 1.10 +++ htdocs/gcc-6/porting_to.html 11 Feb 2016 15:02:29 -0000 @@ -350,6 +350,63 @@ foo (void *p) } </code></pre> +<h2>Plugin issues</h2> + +<p> +The internals of GCC have seen various improvements, and these may affect +plugins. Some notes on porting GCC plugins to GCC 6 follow. +</p> + +<h3>"gimple" became a struct, rather than a pointer</h3> + +<p> +Prior to GCC 6, "gimple" meant a <b>pointer</b> to a statement. It was a +typedef aliasing the type <code>struct gimple_statement_base *</code>: +</p> + +<pre><code> +/* Excerpt from GCC 5's coretypes.h. */ +typedef struct gimple_statement_base *gimple; +typedef const struct gimple_statement_base *const_gimple; +typedef gimple gimple_seq; +</code></pre> + +<p> +As of GCC 6, the code above became: +</p> + +<pre><code> +/* Excerpt from GCC 6's coretypes.h. */ +struct gimple; +typedef gimple *gimple_seq; +</code></pre> + +<p>"gimple" is now the statement <b>struct</b> itself, not a pointer. +The "gimple" struct is now the base class of the gimple statement class +hierarchy, and throughout gcc every <code>gimple</code> was changed to a +<code>gimple *</code> +(revision +<a href="https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=42acab1cd6812e2d9e49f4132176f5505f49a0e5">r227941</a> +was the commit in question). The typedef <code>const_gimple</code> is no more; +use <code>const gimple *</code> if you need to represent a pointer +to a unmodifiable gimple statement. +</p> + +<p> +Plugins that work with gimple will need to be updated to reflect this +change. If you aim for compatibility between both gcc 6 and earlier +releases of gcc, it may be cleanest to introduce a compatibility typedef +in your plugin, such as: +</p> + +<pre><code> +#if (GCC_VERSION >= 6000) +typedef gimple *gimple_stmt_ptr; +#else +typedef gimple gimple_stmt_ptr; +#end +</code></pre> + <h3>Links</h3> </body>