Playing with gcc's intermediate GIMPLE format

前端 未结 3 1588
无人共我
无人共我 2021-02-07 23:41

According to this article gcc uses several intermediate formats before generating code. I read that the GIMPLE format uses three address code, which seems to be the easiest inte

3条回答
  •  我寻月下人不归
    2021-02-08 00:25

    You might find it easier to write a plugin for GCC, which would allow you to hook the GIMPLE generation and alter it inside GCC, which should drop the downtime of saving, editing then trying to compile from GIMPLE form. MELT is one such plugin (though it offers way more than just altering the lower level representations). There is also a nice PDF here on GIMPLE altering plugins.

    Else, you can look here for information on how GCC's GIMPLE works. In terms of dumping GIMPLE out:

    You can request to dump a C-like representation of the GIMPLE form with the flag -fdump-tree-gimple.

提交回复
热议问题