This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Plugin callback interface (Was: plugin events for ICI)
- From: Joern Rennecke <amylaar at spamcop dot net>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: Basile STARYNKEVITCH <basile at starynkevitch dot net>, ctuning-discussions at googlegroups dot com, gcc at gcc dot gnu dot org, Grigori Fursin <grigori dot fursin at inria dot fr>, Grigori Fursin <gfursin at gmail dot com>, Zbigniew Chamski <zbigniew dot chamski at gmail dot com>, Ian Lance Taylor <iant at google dot com>, Albert Cohen <Albert dot Cohen at inria dot fr>, Yuri Kashnikoff <yuri dot kashnikoff at gmail dot com>, Yuanjie Huang <huangyuanjie at ict dot ac dot cn>, Liang Peng <pengliang at ict dot ac dot cn>, dorit at il dot ibm dot com, Mircea Namolaru <NAMOLARU at il dot ibm dot com>, Diego Novillo <dnovillo at google dot com>
- Date: Tue, 01 Dec 2009 08:37:17 -0500
- Subject: Plugin callback interface (Was: plugin events for ICI)
- References: <20091130133452.hgxpnrkgu8cw0gk8-nzlynne@webmail.spamcop.net> <4B1418E2.9050400@starynkevitch.net> <20091130143921.vi6qzwej48so8o8c-nzlynne@webmail.spamcop.net> <4B1421D0.40004@starynkevitch.net> <20091201005430.4w42zvtxcwk4g0s4-nzlynne@webmail.spamcop.net> <84fc9c000912010219n2dcf0103x635aeca1cbfbbf34@mail.gmail.com> <20091201080526.swcn0mh1wo80sc8g-nzlynne@webmail.spamcop.net> <84fc9c000912010515u2e12196cic751f24d2cd474ff@mail.gmail.com>
Quoting Richard Guenther <richard.guenther@gmail.com>:
(Btw, why does invoke_plugin_callbacks not return a value,
that would make code way more readable than going through
the passed by reference appearant return value ...)
Actually, I made it return a value that indicates if a callback took place.
But apparently you want it to return the result of the callback itself.
For that to make sense, the callbacks themselves would have to return
values, and these would have to be somehow accumulated to an overall
return value.
So, either we'd have to change the interface that all existing plugins
use, to give the callbacks a return value, or we'd have to have
different variants of register_callback - or one that takes a union - or
introduce not quite conformant function casts - to accommodate the different
callback function types, and likewise something would have to be done
on the invoke_plugin_callbacks side.