I've been looking into online resources on writing GCC plugins. I'm currently using GCC version 7.3.0. I attempted writing a simple plugin that contained a callback which would be called upon PLUGIN_FINISH_TYPE
. It worked fine.
Next, I'm trying to write a plugin that uses a "gimple pass" similar to the example listed here. However, struct gimple_opt_pass
does not seem to exist.
I tried looking for header files that declare this struct. I found that tree-pass.h has the following code block :-
/* Description of GIMPLE pass. */
class gimple_opt_pass : public opt_pass
{
protected:
gimple_opt_pass (const pass_data& data, gcc::context *ctxt)
: opt_pass (data, ctxt)
{
}
};
- How can I see this from within my plugin? I don't seem to be able to use this in the way as described in the link above.
- With the current GCC plugin API, is it possible to write a pure C plugin(as opposed to having to use C++).