This week I have tested all the plugin callbacks available in GCC The plugins list are defined by plugin.def in GCC. The plugin is initiated by plugin_init function, then the plugin is called through register_callback function. For each plugin, a register_callback is required, then the plugin function will be called and perform any task specified in the program. From there I have determined the correct and working way of plugin callback to call the plugin function. Then I tested the plugins as defined in plugin.def one by one. For the current stage, the plugin was only made to print its name when it is called successfully. Some of the plugins, however, will show error when compiling. Most of the other plugins worked when they were being called.
The plugin that is to be built will have to intercept the compilation stages, before the assembler takes place. Looking into the compilation stage, there are some inner processes. The C/C++ code that we type will be converted to GIMPLE, where it will be separated into blocks of codes.Then it is converted to SSA and lastly to RTL before proceeding to asssembler. The plugin here is predicted to be intercepting at the RTL stage. After triggering the plugins, the upcoming task will be to characterise these plugins, to see which one is triggered at which stage. So that we can manipulate it to our needs in the future. From the current results, I have seen that some of the plugins will be triggered repetitively for many times, as shat is reflected in the output (printing the plugin name for many times). Therefore I believe that there is something going on with some of the plugins in the compilation stages that causes them to be called repeatedly.
0 Comments